Page 1 of 1

Error Log - date_default_timezone_set() - what's this about?

Posted: Wed Jul 02, 2014 9:58 am
by simonmlewis

Code: Select all

[Sun May 04 10:20:38 2014] [warn] [client 81.19.188.235] mod_fcgid: stderr: PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/vhosts/site.fr/httpdocs/index.php on line 442, referer: http://www.site.fr/
We are getting a lot of these in our error log. The site is hosting on a UK server, with many other sites NOT designed for France.

Is this error saying I am using a script calling the date, but it's not set on the server??

Re: Error Log - date_default_timezone_set() - what's this ab

Posted: Wed Jul 02, 2014 10:00 am
by Celauran
You just need to set the time zone in your php.ini. If you don't have access to php.ini, you can use date_default_timezone_set() instead.

Re: Error Log - date_default_timezone_set() - what's this ab

Posted: Wed Jul 02, 2014 10:07 am
by simonmlewis
Can it be set in Plesk under the larger box: Additional configuration directives ?

date_default_timezone_set('Europe/Paris');

Re: Error Log - date_default_timezone_set() - what's this ab

Posted: Wed Jul 02, 2014 10:07 am
by simonmlewis
Bingo yes, as we have this on another server:
date.timezone = "Europe/London"
In that very box.