Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've never seen phpinfo() give errors before. What gives? What should I look for in php.ini?

Warning: phpinfo() [function.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 'EDT/-4.0/DST'
instead in /Users/{me}/Sites/localmirror/htdocs/tests/phpinfo.php on line 3

offending file:




edit: Ah, glimmer of understanding, the warning means I need to set "date.timezone" in php.ini. I thought they were talking about "you" the php programmer, instead they're talking about "you" the sysadmin.

share|improve this question

Do you still get the same error with something like this?

if(date_default_timezone_set('Europe/Stockholm') == 0) {
            print "<!-- Error uknown timezone using UTC as default -->\n";
share|improve this answer
up vote 1 down vote accepted

the answer was to comment out the line date.timezone = ... in my php.ini file and add the appropriate timezone ("US/Eastern" in my case). I guess I was missing the obvious.

share|improve this answer

You may see this as a nuisance but from my point of view it should be required, as I rely a lot on the managing time zone in my PHP applications when inserting dates into MySQL databases, as well as being able to allow changes to the time zone from the user's view, as a server might be placed in New York, while my client would like all his dates to be kept according to Los Angeles time.

This is just my take on it, and you can always switch down to 5.2.xx if you don't want to have this sort of problem, or start setting it in your php.ini or your application.

share|improve this answer
um... could you tell me what "it" is? (e.g. how do I set php.ini accordingly?) – Jason S Oct 17 '09 at 22:40

This is an another php disaster, indeed, how to hell be that stupid not rely on the systemwide settings? php is going now to a miserable direction.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.