モジュール作成時にWarning: date()が出る場合の対処法
symfony1.4でモジュールを追加しようとしたら以下のような警告が
symfony generate:module frontend test PHP Warning: 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 'Asia/Tokyo' for 'JST/9.0/no DST' instead in /usr/share/pear/symfony/config/sfRootConfigHandler.class.php on line 91 PHP Warning: 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 'Asia/Tokyo' for 'JST/9.0/no DST' instead in /usr/share/pear/symfony/config/sfDefineEnvironmentConfigHandler.class.php on line 66
php.iniを編集
vi /etc/php.ini [Date] ; Defines the default timezone used by the date functions ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone date.timezone = Asia/Tokyo
これで警告が出なくなった