加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php警告:strtotime()错误

发布时间:2020-12-13 21:47:02 所属栏目:PHP教程 来源:网络整理
导读:我已将我的joomla和wordpress文件从旧服务器更改为新服务器.在前端和管理端,它的工作没有任何错误.但是在数据库(phpmyadmin)部分,它显示了一些像这样的警告消息. Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezo
我已将我的joomla和wordpress文件从旧服务器更改为新服务器.在前端和管理端,它的工作没有任何错误.但是在数据库(phpmyadmin)部分,它显示了一些像这样的警告消息.

Warning: strtotime() [function.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/Calcutta' for 'IST/5.0/no DST' instead in /usr/share/phpmyadmin/libraries/db_info.inc.php on line 88

Warning: strftime() [function.strftime]: 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/Calcutta' for 'IST/5.0/no DST' instead in /usr/share/phpmyadmin/libraries/common.lib.php on line 1483

能否请您建议,如何隐藏这些警告信息?

提前致谢.

解决方法

你真的只是想隐藏错误信息,或者你想解决问题,他们指出了什么?

在您的新服务器上,您应该在php.ini文件中找到一个设置date.timezone已注释掉.在这里,您必须指定服务器所在的时区.例如,我的服务器位于德国,所以我在这里使用Europe / Berlin:

date.timezone = Europe/Berlin

您可以在此处找到支持的时区的完整列表:

http://www.php.net/manual/en/timezones.php

更改此设置后,重新启动Web服务器并且警告应该消失.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读