2011年4月14日 星期四

解決~~PHP 5.3.0以上版本時區問題

參考這個 網站

<原因>有時候建置網頁時,跟時間有關的服務可能會有問題,在httpd裡的error.log會出現以下錯誤訊息

In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected............

我建議使用修改/etc/php.ini這個方式比較好,這樣所有的網頁系統都可以一次解決

在/etc/php.ini裡面找到
date.timezone這一行,預設這一行是註解的
把他改成
date.timezone = "Asia/Taipei"

然後重啟httpd即可
/etc/init.d/httpd restart

不管有沒有機會遇到,最好建置時就先設定好比較保險 

沒有留言:

張貼留言