PHP Warning: Unknown: It is not safe to rely on the system’s timezone settings.

如题,通过查看php编译参数php -i | grep configure发现如下错误:

PHP Warning: Unknown: 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 Unknown on line 0

解决办法:

编辑php.ini

找到date.timezone =,将前面的注释去掉,改为date.timezone = Asia/Shanghai意思是中国时区,然后重载apache即可

# service httpd reload