执行PHP程序报date()函数异常解决方法
#php/var/www/html/poller.php
PHPWarning:date():Itisnotsafetorelyonthesystem'stimezonesettings.Youare*required*tousethedate.timezonesettingorthedate_default_timezone_set()function.Incaseyouusedanyofthosemethodsandyouarestillgettingthiswarning,youmostlikelymisspelledthetimezoneidentifier.Weselected'Asia/Chongqing'for'CST/8.0/noDST'insteadin/var/www/html/include/global_constants.phponline160
解决方法一:
在提示的文件行数前增加如下设置即可。
date_default_timezone_set("Asia/Chongqing");
解决方法二:
在/etc/php.ini中将date.timezone设置为你所在的时区即:date.timezone="你所在的时区"。
如下:
date.timezone="Asia/Shanghai"
注:修改完配置,重启一下apache服务。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。