Articles in this section

How to change date.timezone parameter for PHP?

kb: how-to Plesk for Linux ABT: Group A

Applicable to:

  • Plesk Onyx for Linux
  • Plesk for Linux

Question

How to change default date.timezone parameter for particular PHP version for all domains at once or for a certain domain?

Answer

For all domains on a PHP handler
  1. Login to Plesk
  2. Click on required PHP version in Tools & Settings > PHP Settings. For example, 7.2.20 FastCGI application:
    border_plus_Screenshot.png
  3. Open PHP configuration file (php.ini tab):
    border_plus_Screenshot_2.png
  4. Browse to date.timezone parameter, remove ; sign before it and specify parameter according to PHP official requirements:
    border_plus_Screenshot__1_.png
    For example:

    CONFIG_TEXT: date.timezone = Europe/London

  5. Click OK button: all required services will be restarted automatically and changes will be applied to all domains assigned to this PHP handler. 
For a certain domain
  1. Login to Plesk
  2. Go to Domains > example.com > PHP Settings.

  3. Specify a time-zone in the Additional configuration directives field. The list of supported time-zones is available here. For example:

    CONFIG_TEXT: date.timezone = Europe/London
    mceclip0.png

  4. Apply the changes. The changes may be verified in domain's php.ini by clicking on View the phpinfo() page

CLI solution for all domains on a PHP handler
  1.  Connect to the server via SSH
  2. Run this command for a certain PHP handler, 7.4 in this example:

    # echo "date.timezone = Asia/Tokyo" >> /opt/plesk/php/7.4/etc/php.ini

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.