首页 > 上网技巧 > 电脑小技巧 > php -i|grep configure报错 PHP Warning

php -i|grep configure报错 PHP Warning

时间:2016-08-16 09:31 作者:QQ地带 我要评论

 
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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
 
解决方法:
方法1:
(最好的方法)在php.ini里加上找到date.timezone项,设置date.timezone = "Asia/Shanghai",重启环境就ok了。
 
方法2:
在需要用到这些时间函数的时候,在页面添加date_default_timezone_set("PRC");
 
方法3:
在页头加上设置时区ini_set('date.timezone','Asia/Shanghai');
 
然后重启web服务器即可。

标签: php
顶一下
(1)
100%
踩一下
(0)
0%

Google提供的广告