> 백엔드 개발 > PHP 튜토리얼 > 想试试cakephp,将其解压到apache的htdocs目录后,访问出现strtotime调用有关问题、时区设置有关问题

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

WBOY
풀어 주다: 2016-06-13 13:50:16
원래의
1076명이 탐색했습니다.

想试试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 597
FileEngine::init() - CORE\cake\libs\cache\file.php, line 81
Cache::_buildEngine() - CORE\cake\libs\cache.php, line 166
Cache::config() - CORE\cake\libs\cache.php, line 141
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
require - APP\webroot\index.php, line 76
[main] - CORE\index.php, line 55

Notice: 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 248

Fatal 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.php

class 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->settings = array_merge(
            array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100),
            $this->settings,
            $settings
        );
        if (!is_numeric($this->settings['duration'])) {
            $this->settings['duration'] = [color=#FF0000][del]strtotime[/del]($this->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, &$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->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.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿