PHP Time Zone Warning IIS7

On a Windows 2008 IIS7 64 bits machine, when you try to browse a simple phpinfo page, you see the following messages:

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/New_York ‘ for ‘10.0/no DST’ instead in C:Inetpubwwwrootphpinfo.php on line 1

To resolve this:

  1. Load up your PHP configuration file (php.ini)
  2. Look for the date.timezone setting (which usually being commented on a default PHP installation).
  3. Change the time zone to your needs. You could refer to for the time zone. Please take note there’s no quote required in between on the time zone (example :  date.timezone = America/New_York )
  4. Restart your IIS via iisreset command prompt
  5. Browse the page and it should showing up the page now. (Clear your browser cache as well if it does not work for you)

The above was found in Windows 2008 64 bits with PHP 5.3.6 environment.

Share With Us About Your Thoughts....