date.timezone warning

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
twistedphrame
Forum Newbie
Posts: 2
Joined: Sun May 02, 2010 8:30 am

date.timezone warning

Post by twistedphrame »

Hello everyone,

I recently installed php version 5.3.2 onto my windows 7 machine with Apache 2.2. When running php.info() I get the error

"Warning: phpinfo(): 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 '-4.0/DST' instead in C:\webserver\webroot\php_html_things _notwith_ee\config.php on line 1 Warning: phpinfo(): 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 '-4.0/DST' instead in C:\webserver\webroot\php_html_things _notwith_ee\config.php on line 1 "

In my php.ini file I've already set the default timzone with this:
date_default_timezone_set('America/New_York');

I also looked at the configuration file path and saw it was:
C:\Windows
so I added a copy of my php.ini to that directory (not sure that made any sense but I figured it wouldn't change anything if it didn't).

I'm not sure of anything else I need to do to get this to run properly.
Thanks for your help
~twistedphrame
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: date.timezone warning

Post by Jonah Bron »

Do you mean you put that function into the php.ini file?
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: date.timezone warning

Post by flying_circus »

date_default_timezone_set('America/New_York'); Needs to go into yout PHP file, not php.ini.

If you want to set the timezone in your php.ini file, use: date.timezone = "America/New_York"
Post Reply