Cakephp 警告(2):strotime()[function.strotime]:依赖系统的时区设置是不安全的

Cakephp 警告(2):strotime()[function.strotime]:依赖系统的时区设置是不安全的,cakephp,Cakephp,/app/config/core.php: 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 th

/app/config/core.php:

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

警告中提到了有问题的函数,您是否搜索了该函数

如果时区无效,则对日期/时间函数的每次调用都将生成E_通知;如果使用系统设置或TZ环境变量,则会生成E_严格或E_警告消息。另请参见日期\默认\时区\设置


换句话说,您应该明确地为您的服务器设置TZ,或者使用

这在这里和其他地方都有很好的文档记录。


成为一名熟练的开发人员的一部分是努力解决自己的问题。这就是你学习的方式。当对这个问题有如此多的报道时,你不太可能在这里找到一个共鸣的耳朵,因为每个人都知道你自己没有做任何努力。

要删除这个E\u STRICT或E\u警告消息,请在app/config/core.php中用date\u default\u timezone\u设置取消对该行的注释。

…是吗?你也愿意提出一个问题吗?幸亏我有能力从无用的错误信息堆中引出问题,我明白为什么凡人可能会有这样的问题:-也许,考虑到问答网站也是如此,你应该问一个问题。我用过它。现在我得到了错误:致命错误:在第177行的/var/www/html/authbridge/lib/Cake/Model/Datasource/Database/Mysql.php中找不到类“PDO”,在Cakephp 2.x下,您必须取消注释并编辑//Configure::write'Config.timezone',Europe/Paris';线路。非常感谢,这是我的问题。这是一个有点自负的伙伴,OP是来寻求帮助的。
/**
 * 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');