重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

执行PHP程序报date()函数异常解决方法

#php /var/www/html/poller.php

创新互联公司主营内黄网站建设的网络公司,主营网站建设方案,APP应用开发,内黄h5成都微信小程序搭建,内黄网站营销推广欢迎内黄等地区企业咨询

 

PHP Warning:  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 in /var/www/html/include/global_constants.php on line 160

 

解决方法一:

在提示的文件行数前增加如下设置即可。

date_default_timezone_set("Asia/Chongqing");

 

解决方法二:

在/etc/php.ini中将date.timezone 设置为你所在的时区即:date.timezone = "你所在的时区"。

如下:

date.timezone = "Asia/Shanghai"

 

注:修改完配置,重启一下apache服务。

 

 

 


网站题目:执行PHP程序报date()函数异常解决方法
标题网址:http://cqcxhl.cn/article/gpesie.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP