首页 文章

致命错误:未捕获的异常'Zend_Cache_Exception',带有消息> 'cache_dir must be a directory'

提问于
浏览
7

完成我的代码更新后 . 我收到了这个错误 . 你能帮我解决这个问题吗?我给了所有文件夹777的权限 . 提前致谢!

致命错误:未捕获的异常'Zend_Cache_Exception',消息'cache_dir必须是C:\ xampp \ htdocs \ mts \ library \ Zend \ Cache.php中的目录':208堆栈跟踪:#0 C:\ xampp \ htdocs \ mts \ library \ Zend \ Cache \ Backend \ File.php(154):Zend_Cache :: throwException('cache_dir must ...')#1 C:\ xampp \ htdocs \ mts \ library \ Zend \ Cache \ Backend \ File . php(121):Zend_Cache_Backend_File-> setCacheDir('C:\ xampp \ htdocs ...')#2 C:\ xampp \ htdocs \ mts \ library \ Zend \ Cache.php(152):Zend_Cache_Backend_File - > __ construct(Array) )#3 C:\ xampp \ htdocs \ mts \ library \ Zend \ Cache.php(93):Zend_Cache :: _ makeBackend('File',Array,false,false)#4 C:\ xampp \ htdocs \ mts \ application \ bootstrap.php(22):Zend_Cache :: factory('Core','File',Array,Array)#5 C:\ xampp \ htdocs \ mts \ library \ Zend \ Application \ Bootstrap \ BootstrapAbstract.php(636) :Bootstrap - > _ initCache()#6 C:\ xampp \ htdocs \ mts \ library \ Zend \ Application \ Bootstrap \ BootstrapAbstract.php(589):Zend_Application_Bootstrap_BootstrapAbstract - > _ executeResource('cache')7#C:\ xampp \ htdocs \ MTS \升第208行的C:\ xampp \ htdocs \ mts \ library \ Zend \ Cache.php中的ibrary \ Zend \ Application \ Bootstrap \ Boots

3 回答

  • 5

    在引导程序中设置缓存

    protected function _initCaching() {
            $frontend = array(
                'lifetime' => 7200,
                'automatic_serialization' => true
            );
            $backend = array(
                'cache_dir' => sys_get_temp_dir(), /**automatically detects**/
            );
            $cache = Zend_Cache::factory('core', 'File', $frontend, $backend);
            Zend_Registry::set('cache', $cache);
        }
    
  • 4

    在条件之前转到第154行的C:\ xampp \ htdocs \ mts \ library \ Zend \ Cache \ Backend \ File.php和 echo $value . 它应该给你一个目录地址 . 确保文件系统中存在该目录 . 基本上,您需要在zend配置中正确设置此路径 .

  • 6

    它's not about permission, ZF can't找到缓存目录 . 检查您在 application.ini 中设置的目录是否确实存在 . 当你在 Windows 机器上时,权限应该不是问题 .

相关问题