Rhythm & Biology

Engineering, Science, et al.

oil refine install時に"It is not safe to rely on the system's timezone settings"と出る場合の対処法

FuelPHPのプロジェクト作成時に

$ oil refine install

としたら以下のようなエラーが表示されるようになりました。

Fatal error: Uncaught exception 'Fuel\Core\PhpErrorException' with message 'date(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.'

1.4以前ではタイムゾーンが指定されていない場合にデフォルトでUTCが選択されていましたが、1.4から上記のようなエラーがでるようになったようです。
http://fuelphp.com/forums/discussion/11506/uncaught-exception-with-message-date-unsafe-to-rely-on-systems-timezone

このページに書かれてる通り、php.iniにタイムゾーンを設定することで正しく動くようになりました。

; php.ini
date.timezone = "Asia/Tokyo"