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/ 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'


Add new comment

Plain text

  • No HTML tags allowed.
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link]( "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.