This tutorial shows you how to change or modify the PHP time zone setting of your PHP application/script using PHP Selector or cPanel’s MultiPHP INI Editor.
There may come a time that you want to change your PHP application time zone to match your current geographic location.
This may be for appointments, meetings and etc.
If you are a cPanel user, there are two options you can use to make this change on your control panel.
The one you elect to use will depend on the hosting package and PHP type that your account is running.
Server-wide timezone changes can only be made by a super-user (in this case, the Infrastructure team).
Given that our customers are from all over the world, we use UTC (Coordinated Universal Time) on most of our production machines.
You can check your current server timezone with:
$ date
The “date” command will display the system date and time with an output similar to this:
Mon Aug 15 02:11:13 UTC 2022
Setting Timezone For Super-Secure PHP Packages (altPHP)
If you are using one of our HardenedPHP packages, you will be using PHP Selector instead of cPanel’s MultiPHP INI Editor for cPanel.
The flow for making this change differs a bit.
To start, log in cPanel
Scroll down to Software and click on PHP Selector.
When the page loads, click on the Options tab.
Look at the available options and you will see “date.timezone”
Visit https://www.php.net/manual/en/timezones.php and select your desired time zone.
Return to the Options tab and add the timezone to the field.
The system will auto-save the changes.
Here is a video on how to make these changes for your hosting account using PHP Selector or MultiPHP INI Editor for cPanel:
Setting Timezone For Upstream Supported PHP (eaPHP):
For customers using upstream or regular PHP, log in to cPanel.
Scroll down to Software and click the “MultiPHP INI Editor“.
Before proceeding, there are a couple of things to bear in mind.
You need to be super careful with the changes you are making as an error could result in non-functional PHP scripts.
cPanel does not allow the use of these directives in PHP settings:
- null
- yes
- no
- true
- false
- on
- off
- none
cPanel does not allow these special characters in any directives you are adding:
?{}|&~