PHP Failure Due To Missing Timezone
I’ve been working on installing PHP 5.3.0 on a new server running Windows Server 2008 R2 and encountered a problem I hadn’t run into before. After installing PHP following the instructions I published here (FastCGI is supported natively by W2K8 R2 so I didn’t need to do anything to use that), the following message was displayed when I navigated to http://localhost/phpinfo.php:
[06-Nov-2009 11:53:17] PHP 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/Los_Angeles’ for ‘-8.0/no DST’ instead in C:\inetpub\wwwroot\phpinfo.php on line 1
The solution is to do exactly what the error message says – set the date.timezone setting in the php.ini file. This must be a new requirement of version 5.3.0 as I didn’t have to add this setting in previous versions. Too bad the folks who added this requirement didn’t talk to the folks who maintain the installation program to add an addition page (or something) to set the time zone. Oh well. It works now
Some notes.
- You may need to stop and restart either the application pool or IIS itself to get it to recognize the change in the
php.inifile. - If you misspell the time zone, you will get the same error. I misspelled Los_Angeles as Los Angeles (space instead of underscore between the two words).
- I’ve changed my article on installing PHP to reflect this newly discovered information.




Leave a Reply