2012-08-10

Scratch of the day - PHP Warning: date(): It is not safe to rely on the system's timezone settings











Yesterday, I noticed one of my Apache server's error log is growing like 1.1 gb in 12 hours. The log is full of these :
[Thu Aug 09 08:42:46 2012] [error] [client 10.10.10.10] 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. ...

Most often, the "date.timezone" of php.ini slip through my mind. Set the correct time zone for php and restart Apache, the error log stops growing.

Another day save :)

Reference :

Aloha!!!

No comments: