Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jrock2004

macrumors 6502
Original poster
May 4, 2008
375
0
PA
So I am using the web sharing feature that is built in with Mac and have enabled PHP support. I installed a Wordpress site and that went thru smoothly. The issue is when I am viewing the site I am getting a bunch of these type warnings

Code:
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 'EDT/-4.0/DST' instead in /Users/john/Documents/Development/Web Development/myBlog/betatesting/wp-includes/functions.php on line 35

I went into the php.ini file and set the timezone and restarted the computer and I still get this error. So is this actually a WP issue or a server issue? Could I just tell the server to hide these warnings since this is a testing environment only? Thanks for your help.
 
So I am using the web sharing feature that is built in with Mac and have enabled PHP support. I installed a Wordpress site and that went thru smoothly. The issue is when I am viewing the site I am getting a bunch of these type warnings

Code:
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 'EDT/-4.0/DST' instead in /Users/john/Documents/Development/Web Development/myBlog/betatesting/wp-includes/functions.php on line 35
I went into the php.ini file and set the timezone and restarted the computer and I still get this error. So is this actually a WP issue or a server issue? Could I just tell the server to hide these warnings since this is a testing environment only? Thanks for your help.

Did you replace the strtotime() function in line 35 of that script to date_default_timezone_set() as it instructs? Did you try using whatever the value is for date.timezone being passed to strtotime() as also suggested? Two fixes to try.

Is this a plugin or hack you or someone else wrote for Wordpress? Wordpress has its own timezone functions and procedures is the point. Also, Wordpress apparently directly reads the server's time zone data files which are files, usually in /usr/share/zoneinfo on most *nix systems. The name of the data file mentioned in the warning, "EDT/-4.0/DST" is wrong so it defaulted to "America/NewYork" which actually is the name of one of those time zone data files on the server. Adjusting PHP.INI will not resolve the issue, only hide warnings which is not advisable on any development platform. Fix it, don't just "hide" it. That's not good.

If the above suggestions do not work, you need to post the relevant code near and including line 35 and we'll help you resolve this.

I also want to comment that you should be using MAMP for localhost development - it does not have problems like this, is separate software so easy to upgrade and maintain without affecting the core Mac settings or software. I suggest switching immediately.

-jim
 
I did not edit anything cause this is a default WP install. No plugins or anything. I am trying to locate this strtotime but that line only calls a variable into another.
 
Your WP is pulling "EDT/-4.0/DST" as the time zone from somewhere. This whole thing is based on that value being not what WP expects. Check in the configuration or let us know if you're running the "automated time zone" plugin which might be part of the distribution.

I'm referring to this plugin. If you've got it, read the FAQ link there.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.