2013-02-20 98 views
3

我已将旧joomla和wordpress文件从旧服务器更改为新服务器。在前端和管理端其工作没有任何错误。但在数据库(phpMyAdmin的)第它显示了一些这样的警告消息..php警告:strtotime()错误

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 

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

在此先感谢。

+0

***注:***了'PHP-cli'的'php.ini'文件不同于'apache2''' .ini'文件。我建议将符号链接到另一个以保持同步并避免混淆! – 2014-02-15 19:45:55

回答

-4

在php.ini文件:display_errors = Off

+2

这不是一个很好的解决方案,他们可能会遇到的任何其他错误。隐藏所有错误不是一个好主意。 – Tom 2014-01-28 16:29:20

4

你真的只是想隐藏的错误讯息或你想解决的问题,他们表示?

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

date.timezone = Europe/Berlin 

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

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

更改此设置后,重新启动您的Web服务器,警告应该消失。

1

最好的方法是设置默认时区。 在config.inc.php文件,插入一个一行:

date_default_timezone_set('America/Sao_Paulo'); 

在我来说,我在你的情况下使用“美洲/圣保罗”我认为这是“亚洲/加尔各答”

如需详细了解时区,请访问:http://php.net/manual/en/function.date-default-timezone-set.php

1
date_default_timezone_set('Europe/London'); 

试试这个PHP代码可能是你的问题已经解决...