strtotime warning from WordPress/PHP

by Roger Collins on December 26, 2009

in Internet,Programming

If you try to install WordPress with the PHP and MySQL procedures I recently posted you’ll get the following warning all over your WordPress pages.

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 selected ‘America/New_York’ for ‘EST/-5.0/no DST’ instead in file-name-here on line NN

Here’s how to fix it.  Edit (or create if it does not exist) /etc/php.ini and add the following line:

date.timezone = “America/New_York”

Then restart  your web server:

sudo /usr/sbin/apachectl restart

Be Sociable, Share!

{ 2 comments… read them below or add one }

kc January 12, 2010 at 2:18 pm

the wp discussions mention this too. any idea why editing php.ini did not work? i restarted apache, but that did not do it. for now, i have to use the ugly fix of editing functions.php

Roger Collins January 12, 2010 at 2:35 pm

My first guess would be you edited the wrong php.ini. Create a phpinfo.php in your top-level wp directory with the code:

< ?php phpinfo() ?>

View that file in your browser and find the line that tells you the path of the php.ini file to make sure it is the same one you edited.

Leave a Comment

Previous post:

Next post: