想试试cakephp,将其解压到apache的htdocs目录后,访问出现strtotime调用有关问题、时区设置有关问题

php中文网
发布: 2016-06-13 10:06:08
原创
951人浏览过

想试试cakephp,将其解压到apache的htdocs目录后,访问出现strtotime调用问题、时区设置问题
下面是访问cakephp目录下的index.php浏览器给出的提示

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->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 'UTC' for '8.0/no DST' instead [CORE\cake\libs\cache.php, line 597]Code | Context$settings    =    array(    "engine" => "File",    "path" => "I:\Apache\Apache2.2\htdocs\cakephp-1.3.9-0\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 597FileEngine::init() - CORE\cake\libs\cache\file.php, line 81Cache::_buildEngine() - CORE\cake\libs\cache.php, line 166Cache::config() - CORE\cake\libs\cache.php, line 141Configure::__loadBootstrap() - CORE\cake\libs\configure.php, line 421Configure::getInstance() - CORE\cake\libs\configure.php, line 52include - CORE\cake\bootstrap.php, line 38require - APP\webroot\index.php, line 76[main] - CORE\index.php, line 55Notice: Trying to get property of non-object in I:\Apache\Apache2.2\htdocs\cakephp-1.3.9-0\cake\libs\cache\file.php on line 248Fatal error: Call to a member function cd() on a non-object in I:\Apache\Apache2.2\htdocs\cakephp-1.3.9-0\cake\libs\cache\file.php on line 248
登录后复制



我然后看了下它所提示的源代码:

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->//cache.phpclass CacheEngine {/** * Settings of current engine instance * * @var int * @access public */    var $settings = array();/** * Initialize the cache engine * * Called automatically by the cache frontend * * @param array $params Associative array of parameters for the engine * @return boolean True if the engine has been succesfully initialized, false if not * @access public */    function init($settings = array()) {        $this-&gt;settings = array_merge(            array('prefix' =&gt; 'cake_', 'duration'=&gt; 3600, 'probability'=&gt; 100),            $this-&gt;settings,            $settings        );        if (!is_numeric($this-&gt;settings['duration'])) {            $this-&gt;settings['duration'] = [color=#FF0000][del]strtotime[/del]($this-&gt;settings['duration']) - time();[/color]        }        return true;    }/** * Garbage collection * * Permanently remove all expired and deleted data * * @access public */    function gc() {    }/** * Write value for a key into cache * * @param string $key Identifier for the data * @param mixed $value Data to be cached * @param mixed $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure * @access public */    function write($key, &amp;$value, $duration) {        trigger_error(sprintf(__('Method write() not implemented in %s', true), get_class($this)), E_USER_ERROR);    }/** * Read a key from the cache * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */    function read($key) {        trigger_error(sprintf(__('Method read() not implemented in %s', true), get_class($this)), E_USER_ERROR);    }/** * Increment a number under the key and return incremented value * * @param string $key Identifier for the data * @param integer $offset How much to add * @return New incremented value, false otherwise * @access public */    function increment($key, $offset = 1) {        trigger_error(sprintf(__('Method increment() not implemented in %s', true), get_class($this)), E_USER_ERROR);    }/** * Decrement a number under the key and return decremented value * * @param string $key Identifier for the data * @param integer $value How much to substract * @return New incremented value, false otherwise * @access public */    function decrement($key, $offset = 1) {        trigger_error(sprintf(__('Method decrement() not implemented in %s', true), get_class($this)), E_USER_ERROR);    }/** * Delete a key from the cache * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed * @access public */    function delete($key) {    }/** * Delete all keys from the cache * * @param boolean $check if true will check expiration, otherwise delete all * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */    function clear($check) {    }/** * Cache Engine settings * * @return array settings * @access public */    function settings() {        return $this-&gt;settings;    }/** * Generates a safe key for use with cache engine storage engines. * * @param string $key the key passed over * @return mixed string $key or false * @access public */    function key($key) {        if (empty($key)) {            return false;        }        $key = Inflector::underscore(str_replace(array(DS, '/', '.'), '_', strval($key)));        return $key;    }}<div class="clear"></div>
登录后复制
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号