2011-08-07 16 views
0

我得到了getdate();在我的Etomite安裝的每個頁面下面的PHP解析錯誤。在PHP 5.3.6上用getdate()觸發這個PHP分析錯誤是什麼?

由於我嘗試將我的服務器時區設置爲EST/EDT,但錯誤仍然存​​在。我也搜索了Etomite論壇和StackOverflow,但找不到解決方案。

注:服務器最近已經更新到5.3.6 PHP

這裏的錯誤,任何幫助將不勝感激!


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 

+1

它不是一個語法錯誤,這是一個錯誤確定您的時區。你準確地設置了你的時區和地點? – deceze

+2

它在調試中已經說明了,不是嗎? 「依靠系統的時區設置是不安全的,你需要*使用date.timezone設置或者date_default_timezone_set()函數。如果你使用了這些方法中的任何一種,並且你仍然得到這個警告,你最可能拼錯了時區標識符。「 –

+1

我認爲你應該爲時區選擇不同的格式。看到這個:http://www.zen-cart.com/forum/showthread.php?t=150719 –

回答

2

未指定時區時,PHP將報告E_STRICT錯誤。在你的情況,包括該文件之前,違規調用發生在visitor_logging.inc.php.

某處的81線,您可以設置時區與下面的調用:

// Use your own correct time zone 
date_default_timezone_set('America/Los_Angeles'); 
+0

這固定它。我非常感謝你的時間和迴應......你搖滾! –