PHP date.timezone警告

前端之家收集整理的这篇文章主要介绍了PHP date.timezone警告前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直收到这个错误

Message: date() [function.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 ‘America/New_York’ for ‘EST/-5.0/no DST’ instead

我编辑了我的PHP.ini并将其添加到它的末尾:date.timezone =“America / New_York”

保存PHP.ini并重新启动Apache后,我仍然收到错误.我也试过重启整个服务器无济于事.

我在CentOS 5.6上运行cPanel / WHM,如果这有任何区别的话.此外,PHP处理程序是suPHP.

我不确定接下来会尝试什么…任何指导?

打开相应的PHP.ini文件添加以下内容,将时区替换为适合您的时区(时区名称列表 – http://php.net/date.timezone):
[Date]
; Defines the default timezone used by the date functions
; http://PHP.net/date.timezone
date.timezone = "America/Chicago"

更多细节:

http://forums.modx.com/thread/33294/solved-warning-strtotime-function-strtotime-in-evo-1-01-on-php-5-3-0

原文链接:https://www.f2er.com/php/139198.html

猜你在找的PHP相关文章