Diadem Technologies Hosting Knowledgebase

How to set PHP Timezone for a Website in Plesk

Article ID: 1287
Last updated: 14 May, 2020

How to set php.ini configuration of PHP handler for custom time-zone settings

   Most PHP applications (e.g. WordPress) set the required date/time within the application so that it's a user configurable option.

     Step 1: Login to Plesk panel and then select the domain you need to set the PHP timezone for. Select PHP Settings a picturized below.

        

     Step 2: At the bottom of the page add the following line into the Additional directives section as shown below and click on OK to save the settings.

            For example, you want to add date.timezone = "Asia/India"

      

  Step 3: Scroll to the top of the PHP Settings page, then select View the phpinfo() page:

     

  Step 4: This will open a page displaying all of the configured PHP information. Scroll down to the date section to verify that the timezone has been updated properly.

       

  Step 5: You can now click OK on the PHP Settings page to finalize the settings.

Sample error message: >[Mon Mar 02 15:12:36 2020] [error] [client XXXXXXXX] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /var/www/vhosts/domain_name/httpdocs/beta/includes/config.php on line 7

This article was:  
Report an issue
Article ID: 1287
Last updated: 14 May, 2020
Revision: 18
Views: 578
Comments: 0