0

我得到了 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

4

1 回答 1

2

E_STRICT未指定时区时,PHP 会报错。在您的情况下,违规调用发生在第 81 行visitor_logging.inc.php.

在包含该文件之前的某处,您可以使用以下调用设置时区:

// Use your own correct time zone
date_default_timezone_set('America/Los_Angeles');
于 2011-08-07T02:10:13.373 回答