• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Plesk PHP date.timezone

Chris1

Regular Pleskian
Hello,

Does the Plesk PHP ini files set the date.timezone parameter automatically?

I only just enabled the server to synchronize with a NTP server via Tools & Settings > System Time, however I have a client getting a PHP warning:

Code:
PHP Warning:  date(): It is not safe to rely on the system's timezone settings.

I see that the date.timezone parameter is not set in /opt/plesk/php/5.X/etc/php.ini, will this automatically update given that I just configured the Plesk system time? Or is there a command I can run to make it sync now? Or do we have to update this parameter manually?
 
Hi Chris1,

Or do we have to update this parameter manually?

You have to set specific timezones on your very own.

Example for Germany:
Code:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone= "Europe/Berlin"

; http://php.net/date.default-latitude
date.default_latitude = 51.248532

; http://php.net/date.default-longitude
date.default_longitude = 6.704677
Please see as well: http://php.net/manual/en/timezones.php

Consider as well, to use other "error_reporting" - settings, to avoid such messages: http://php.net/manual/en/function.error-reporting.php
 
Hi @UFHH01

Thank you, I will set these manually. I was worried that Plesk would override my adjustment to the php.ini files.

Perhaps Odin could integrate the timezone information from the system time?

Oh error reporting is ok, I believe they got the error from the output of a cron task.
 
I had to go in and set it under the PHP settings for the already setup hosting account to get this to work.
 
Hello,

I am coming to you because it is impossible to have the dates in French on our site, the default comes from Plesk because we had it before under cPanel and the dates were in French.

We have updated the php.ini file, the server and when we go to the phpinfo file we have the timezone in Europe / Paris.

We don't know what to do anymore, I hope someone has a lead or a solution.

thank you in advance
 
Back
Top