支付宝接口:Warning: date(): It is not safe to rely on the system's timezone settings. You are *required*

调试支付宝接口出现错误:


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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in E:\phpStudy\WWW\live_cms\00\pagepay\service\AlipayTradeService.php on line 224

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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in E:\phpStudy\WWW\live_cms\00\aop\AopClient.php on line 341


解决办法:

方法1:


(最好的方法)在php.ini里加上找到date.timezone项,去掉前面的";",添加设置date.timezone = "Asia/Shanghai",北京的时间也写成上海那个。

重启环境,然后出现如下问题:

Warning: date(): Invalid date.timezone value 'Asia/Beijing', we selected the timezone 'UTC' for now. in D:\Tomcat\apache-tomcat-7.0.77\webapps\webOne\qshxxkj\WEB-INF\php-bin\Wxpay\example\h5.php on line 16
在php.ini中date.timezone = "Asia/Shanghai",加上如下这句话即可:

date_default_timezone_set('UTC');

重启服务即可。


引用:https://blog.csdn.net/swimming_in_it_/article/details/78518397



猜你喜欢

转载自blog.csdn.net/haibo0668/article/details/81066066
今日推荐