Plesk for Linux
kb: how-to
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
- 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:CONFIG_TEXT: 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:
CONFIG_TEXT: 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
Comments
3 comments
Hi Yulia Plokhotnikova,
Should or shouldn't time zone be in quotes?
date.timezone = "Asia/Jerusalem"
Where else in addition to Plesk->Tools->Time Settings can we find timezone configured?
wp-config?
WordPress?
Additional places?
Which one of the above superseds?
@Ehud Ziegelman,
timezone specified in PHP Settings is site's PHP.info page, while time specified in Wordpress side is time that is displayed on Wordpress admin dashboard side, for example, timing for new posts:https://wordpress.org/support/article/formatting-date-and-time/
From Plesk standpoint, only the timezone in PHP Settings (phpinfo.php) is applicable for a site. Other ways to change timezone for a site are not related to Plesk.
Hello @Ehud Ziegelman,
no quotes needed for PHP date.timezone parameter. I will check the other question and let you know.
Please sign in to leave a comment.