php运行时遇到的一些问题和解决方案

1.用php脚本向服务器请求数据的时候,总是出现一些警告信息:

PHP Warning:  strtotime(): 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

/data/svc/dataserver/scripts/CDataCache.php on line 1392


原因:时区问题导致。

解决方案:在最开始用到的php脚本的最前面加上这行代码:ini_set('date.timezone','Asia/Shanghai');问题就解决了。

猜你喜欢

转载自blog.csdn.net/e1256325535/article/details/51520481