php 程序设置的时区信息,与本地使用时区保持不一致如何解决?

asp网站上传图片

显示:如图所示

服务器错误

500 - 内部服务器错误。
您要查找的资源有问题,无法显示。

这边登录服务器尝试开启详细的报错,尝试上传时页面返回php 程序告警信息,如附件。看提示是php 程序时区设置问题,您可以调整下php 程序设置的时区信息,与本地使用时区保持一致,然后再操作看是否正常。 

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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in E:\www\ttjgcom\admin\include\kindeditor\php\upload_json.php on line 145
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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in E:\www\ttjgcom\admin\include\kindeditor\php\upload_json.php on line 152

 重点来了,具体解决方法:

在服务器找到php程序中的php.ini,注意复制一下备个份

用文件打开-搜索-date.timezone

[Date]
; Defines the default timezone used by the date functions
;date.timezone =

 修改成

[Date]
; Defines the default timezone used by the date functions
date.timezone =PRC

前面分号是注释

其中PRC是“中华人民共和国”!

最后 重启服务器 完美解决,网站可以正常上传图片了!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值