I'm getting the following error all over my websites after upgrading to PHP 5.3.8:
Warning: strtotime() [function.strtotime]: 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 s开发者_JAVA百科elected 'America/Chicago' for 'CDT/-5.0/DST' instead in ....
My php.ini file has date.timezone = "America/Chicago" so I'm not sure why this warning is being thrown.
Note
Defining on a per page basis is not feasible at this point. This is impacting several websites and thousands of pages. I have checked phpinfo() for the site and see the following response:
http://screencast.com/t/EPOCW9VdR
double check that the php.ini that has the timezone setting is the one php is loading. you can check phpinfo() for which one is being used. Also, maybe restart apache.
although, defining on a per page basis is not feasible as you stated, although not idea, if using apache, you can set the value in a .htaccess or the httpd.conf file. php_value date.timezone America/Chicago even if just a temp fix.
So you can accept and close the question. Thanks.
You can declare the timezone within your php file using
date_default_timezone_set('America/Los_Angeles');
精彩评论