• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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