Having issues with applying the 'date.timezone' value through the PHP Selector in cPanel? Don't worry, we've got you covered. Follow the steps below to resolve this issue:
Step 1: Viewing the Current 'date.timezone' Value
First, you need to check the current 'date.timezone' value. To do this, you can use a phpinfo() file. Here's how:
- Log into your cPanel account.
- Navigate to the 'File Manager'.
- In the public_html directory, create a new file and name it 'phpinfo.php'.
- Edit this file and add the following line of code: <?php phpinfo(); ?>
- Save the changes and close the file.
- Now, open a new browser tab and navigate to 'yourdomain.com/phpinfo.php'. Replace 'yourdomain.com' with your actual domain name.
- On this page, you'll see a lot of information about your PHP configuration. Look for the 'date.timezone' value.
Step 2: Changing the 'date.timezone' Value
If the 'date.timezone' value is empty or incorrect, you can easily change it through the PHP Selector. Here's how:
- Go back to your cPanel main dashboard.
- Navigate to 'Software' and then click on 'Select PHP Version'.
- Click on 'Switch to PHP Options'.
- Here, you'll see a list of various PHP options. Find 'date.timezone' and click on its current value.
- In the text box, enter your desired timezone in double quotes. For example, if you want to set it to London time, you would enter: "Europe/London".
The double quotes are important because the slash (/) in the timezone value can break the contents and pass it through incorrectly. Using double quotes fixes this issue.
- Click on 'Apply', and then 'Save' to save your changes.
And that's it! You have successfully set the 'date.timezone' value through the PHP Selector in cPanel.