Fix PHP 5.3 timezone warnings for drupal
I recently installed drupal 6.14 on Snow Leopard and got these timezone warnings.
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 'Asia/Tokyo' for 'JST/9.0/no DST' instead in /Users/<user>/Sites/drupal/sites/all/modules/views/modules/node/views_handler_argument_dates_various.inc on line 67.
Apparently PHP 5.3 wants the timezone to have been set. The timezones to set for date.timezone can be found here.
I didn't have a /etc/php.ini but a /etc/php.ini.default which contains a bunch of default settings. First thing I tried was to use it as php.ini and setting a proper date.timezone value however I couldn't get drupal to run and didn't want to waste time in troubleshooting PHP/php5_module.
A quick fix is to create a new /etc/php.ini with only the date.timezone setting.
date.timezone = 'Asia/Tokyo'


Comments
date.timezone = 'Asia/Tokyo'
In my case 'America/Los_Angeles'. Doesn't work, still have same errors.