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
- Login to Plesk
- Click on required PHP version in Tools & Settings > PHP Settings. For example, 7.2.20 FastCGI application:
- Open PHP configuration file (php.ini tab):
- Browse to
date.timezone
parameter, remove ; sign before it and specify parameter according to PHP official requirements:
For example:date.timezone = Europe/London
- 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
- Login to Plesk
-
Go to Domains > example.com > PHP Settings.
-
Specify a time-zone in the Additional configuration directives field. The list of supported time-zones is available here. For example:
date.timezone = Europe/London
-
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
- Connect to the server via SSH
-
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