解决校正PHP服务器时间不准的问题

修改php.ini文件后重新启动PACHE服务器

date.timezone = RPC

如果你在php.ini文件加上上面那段代码,重启Apache又出现下面的错误

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.......

还需要在php.ini里添加一行代码

date.timezone = "Asia/Shanghai"

重启Apache,时间正确了.没有错误提示了.

你可能感兴趣的:(PHP)