我有這種錯誤如何解決以下聰明的錯誤? (或php 5.3.8)
Warning: 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 'EDT/-4.0/DST' instead in /var/www/html/includes/functions.php on line 1444
和此錯誤
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 'America/New_York' for 'EDT/-4.0/DST' instead in /var/www/html/includes/templatelib/plugins/modifier.date_format.php on line 37
和此錯誤
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 'America/New_York' for 'EDT/-4.0/DST' instead in /var/www/html/includes/functions.php on line 3538
我已閱讀,第一是由引起最新的PHP版本,但其他2個是smary錯誤
我在durpal上看到論壇上,類似的錯誤,以一日一和修復是編輯的php.ini
和修復是添加像date.timezone = "America/New_York"
一個時區,不爲我工作
編輯
好吧,所有人都同意1解決方案,我應該編輯我的源代碼,應該改變php.ini中的任何內容?因爲到目前爲止,我一直在試圖從php.ini的修正並沒有奏效
固定它
我不得不改變我的VPS時區
ln -sf /usr/share/zoneinfo/GMT /etc/localtime
,做同樣的與php.ini中,我也忘了重新啓動Apache笑:d
編輯* correct * php.ini文件意味着您不需要編輯每個運行的php腳本。它沒有工作的事實很可能意味着你一直在編輯錯誤的文件。檢查phpinfo()的輸出並確保它正在加載正確的文件。 –
@Blair McMillan根據php info文件,我只有1個php.ini文件位於/ etc/php。ini – Lynob