在 PHP 5.3.6 上,是什么触发了 getdate() 的 PHP 解析错误?
我得到了 getdate();我的 Etomite 安装的每个页面上都出现 PHP 解析错误。
由于我尝试将服务器时区设置为 EST/EDT 但错误仍然存在。我也搜索了 Etomite 论坛和 StackOverflow,但没有找到解决方案。
注意:服务器最近已更新到 PHP 5.3.6
这是错误,任何帮助将不胜感激!
Etomite encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: getdate(): 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/Los_Angeles' for 'PDT/-7.0/DST' instead
Error type/ Nr.: Warning - 2
File: /var/www/vhosts/xxxxxxxxxxxxx.ca/httpdocs/manager/includes/visitor_logging.inc.php
Line: 81
Line 81 source: $accesstime = getdate();
Parser timing
MySQL: 0.0000 s s (0 Requests)
PHP: 0.0086 s s
Total: 0.0086 s s
I am getting the getdate(); PHP parse error below on every page of my Etomite install.
Since I tried setting my server timezone to EST/EDT but the error persists. I also searched the Etomite forum and StackOverflow but could not find a solution.
Note: The server has recently been updated to PHP 5.3.6
Here's the error, any help would be greatly appreciated!
Etomite encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: getdate(): 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/Los_Angeles' for 'PDT/-7.0/DST' instead
Error type/ Nr.: Warning - 2
File: /var/www/vhosts/xxxxxxxxxxxxx.ca/httpdocs/manager/includes/visitor_logging.inc.php
Line: 81
Line 81 source: $accesstime = getdate();
Parser timing
MySQL: 0.0000 s s (0 Requests)
PHP: 0.0086 s s
Total: 0.0086 s s
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果未指定时区,PHP 将报告
E_STRICT
错误。在您的情况下,有问题的调用发生在visitor_logging.inc.php 的第 81 行。
在包含该文件之前的某个位置,您可以使用以下调用设置时区:
PHP will report an
E_STRICT
error when the timezone isn't specified. In your case, the offending call occurs on line 81 ofvisitor_logging.inc.php.
Somewhere before that file is included, you can set the timezone with the following call: