It is not safe to rely on the system’s timezone settings

gentoo上安装的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/Chongqing’ for ‘CST/8.0/no DST’ instead in /home/gentoo/www/blog/i.php on line 368

原来是php.ini的设置问题。把php.ini中的时区设置正确就可以了:

#date.timezone =

改为:

date.timezone = “Asia/Shanghai”

发表评论

电子邮件地址不会被公开。