1、php时区错误
提示信息大概是:
Warning: phpinfo(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in/usr/local/apache2/htdocs/index.phpon line2
解决方案:
1、修改php.ini中的date.timezone = UTC还确实是正解,修改后要重新启动apache
2、如果还不行你就在php代码中加上类似
date_default_timezone_set('UTC'); //北京时间用Asia/Shanghai的一行,要在你调用任何时间函数之前。