Warning (2): 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 'Asia/Calcutta' for '5.5/no DST' instead [CORE\cake\libs\cache.php, line 570]
Code | Context
$settings = array(
"engine" => "File",
"path" => "C:\xampp\htdocs\cakephp\app\tmp\cache\persistent\",
"prefix" => "cake_core_",
"lock" => false,
"serialize" => true,
"isWindows" => true,
"duration" => "+10 seconds",
"probability" => 100
)
strtotime - [internal], line ??
CacheEngine::init() - CORE\cake\libs\cache.php, line 570
FileEngine::init() - CORE\cake\libs\cache\file.php, line 81
Cache::_buildEngine() - CORE\cake\libs\cache.php, line 151
Cache::config() - CORE\cake\libs\cache.php, line 126
Configure::__loadBootstrap() - CORE\cake\libs\configure.php, line 421
Configure::getInstance() - CORE\cake\libs\configure.php, line 52
include - CORE\cake\bootstrap.php, line 38
[main] - APP\webroot\index.php, line 76
Notice: Trying to get property of non-object in C:\xampp\htdocs\cakephp\cake\libs\cache\file.php on line 248
Fatal error: Call to a member function cd() on a non-object in C:\xampp\htdocs\cakephp\cake\libs\cache\file.php on line 248
回答
/app/config/core.php:
/**
* If you are on PHP 5.3 uncomment this line and correct your server timezone
* to fix the date & time related errors.
*/
//date_default_timezone_set('UTC');
我用過它。現在我收到錯誤:致命錯誤:類'PDO'找不到在/var/www/html/authbridge/lib/Cake/Model/Datasource/Database/Mysql.php在線177 – 2012-07-13 12:15:11
謝謝你的工作。 – 2014-01-30 16:15:34
另外,在Cakephp 2.x下,您必須取消註釋並編輯'//Configure::write('Config.timezone','Europe/Paris');'line。 – Eugen 2015-01-02 21:54:09
非常警告提到有問題的功能,你是否搜索過這個功能? Here's what it says in the docs:
Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT or E_WARNING message if using the system settings or the TZ environment variable. See also date_default_timezone_set()
換句話說,你應該明確地設置TZ爲您的服務器,either in php.ini,或使用date_default_timezone_set()
這是非常好,在這裏和其他地方的記錄。 Timezone and more problems with Cakephp 1.3 and PHP 5.3.2
成爲精通開發人員的一部分是努力解決自己的問題。這就是你學習的方式。如果對這個問題有如此多的報道,那麼你不可能在這裏找到同情的耳朵,因爲每個人都知道你自己並沒有做出任何努力。
這是一個有點自負的隊友,OP在這裏尋求幫助。 – elliotrock 2016-03-15 07:10:48
要刪除此E_STRICT或E_WARNING消息請取消註釋app/config/core.php
- 1. 「依靠系統的時區設置是不安全的」
- 2. date_default_timezone_get():依靠系統的時區設置是不安全的
- 3. PHPMailer的date_default_timezone_get():這是不是安全的依靠系統的時區設置
- 4. PHP strtotime函數 - 依靠系統的時區不安全?
- 5. Acme Bundle安裝錯誤:警告依靠系統的時區設置是不安全的
- 6. phpDocumentor的,沒有工作,PHP的警告:的strftime():這是不是安全的依靠系統的時區
- 7. `[異常]日期時間:: __結構():'這是不是安全的依靠系統的時區設置
- 8. PHP日期時間錯誤| date_create()[function.date-create]:依靠系統的時區設置是不安全的
- 9. PHP錯誤「依靠系統的時區設置是不安全的。」當使用$ _GET
- 10. spacemacs警告:目錄是不安全的
- 11. PHP&MySQL - 爲什麼依賴系統時間設置不安全?
- 12. 這是安全的設置區塊內的屬性
- 13. 我的登錄系統是安全的?
- 14. 問題用的strtotime(和設置時區
- 15. Mysql的設置系統時區
- 16. 警告ZODB.blob ...具有不安全的模式設置
- 17. 抑制gcc警告:「警告:這是以前定義的位置」
- 18. 這是php/mysql表達式(它設置連接的時區)足夠安全嗎?
- 19. 配置文件的PhpMyAdmin安全警告
- 20. ios - 是否有iPhone/iPad生態系統的可靠崩潰報告系統?
- 21. 這是不必要的警告嗎?
- 22. 計算日期時依靠毫秒是否安全?
- 23. 自動在證書上點擊是安全警告和Windows安全警告
- 24. 本地時區不是系統時區的一部分
- 25. 所有的系統調用都是非實時安全的嗎?
- 26. SimpleDateFormat的Checkstyle/PMD規則不是線程安全警告
- 27. 完全依靠Cassandra構建的票證預訂系統
- 28. 警告:opendir():系統找不到指定的文件。 (代碼:2)
- 29. Safety_Question - 不可判定的證明系統是安全的
- 30. 自定義過時的警告,在c#中拋出級別4的警告,而不是級別2的警告#
與
date_default_timezone_set
行......是嗎?你是否也想制定一個問題? – deceze 2010-12-13 11:59:38有幸能夠從其他無用轉儲錯誤消息中獲得問題的能力,我可以看出爲什麼凡人可能會遇到這種問題:-)也許,考慮到SO是一個問答網站,您應該問一個問題。 – paxdiablo 2010-12-13 11:59:57