Cacti編譯安裝錯誤: Warning: strtotime(): It is not safe to rely on the system's timezone settings.

環境: LAMP

php解析正常, 將cacti的目錄解壓並放到/usr/local/apache/htdocs/cacti以後, 導入cacti.sql到mysql的cacti數據庫, 瀏覽器輸入網址: http:/ip/cacti, 出現如下錯誤:

Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/apache/htdocs/cacti/include/global_constants.php on line

Google搜索到, 在出現問題的php裏面, 添加如下項: 如/usr/local/apache/htdocs/cacti/include/global_constants.php

if( ! ini_get('date.timezone') )
{
    date_default_timezone_set('Asia/Chongqing');
}

有說在php.ini裏面, 修改date.timezone = "Asia/chongqing", 但實際中並沒起到作用, 因此可以試試上述的方法.

發佈了18 篇原創文章 · 獲贊 12 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章