560
技術社區[雲棲]
php timezone獲取錯誤
在測試ECSHOP網站的時候,在執行安裝時出現timezone錯誤,錯誤內容大概如下:
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 'Europe/Helsinki' for 'EEST/3.0/DST' instead in /path/to/my/www/wp-includes/functions.php on line 35
這是貼的別人的錯誤,我的錯誤在經過下麵改正後通過了,也沒記下來
錯誤原因:php認為你的timezone是不可靠的。以下是某大俠Dan.LaSota提供的方法,可能不能解決你的問題,僅作參考:
And thank you for this ,Dan.
According to the article:
https://wordpress.org/support/topic/php-530-amp-wp-28-it-is-not-safe-to-rely-on-the-systems-timezone
Another way to approach this is to let php know what your time zone is. You can edit your php.ini file and put in the following line:
date.timezone = "Asia/Chongqing"
You can find valid time zone strings at https://nl3.php.net/manual/en/timezones.php
最後更新:2017-11-06 12:33:59