phpエラー:It is not safe to rely on the system’s timezone settings.






別PCからデータを移したXAMPP先でエラー発生。XAMPPは関係なしにPHPで下記のようなエラーが出る場合
Warning: date() [function.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 ’9.0/no DST’ instead in C:***/***/***.php on line **
タイムゾーンの設定がなされていない事が原因。
下記設定を追加。
date_default_timezone_set(‘Asia/Tokyo’);
参考
date関数で”Asia/Tokyo・・”なんかのエラーが出る件:PHP5.1.0以降
It is not safe to rely on the system’s timezone settings.