Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Uncaught exception 'Zend_Cache_Exception' with message > 'cache_dir must be a directory'

After doing my code update. I got this error. Could you help me figure this one out? I gave 777 permission to all of the folders. Thanks in advance!

Fatal error: Uncaught exception 'Zend_Cache_Exception' with message 'cache_dir must be a directory' in C:\xampp\htdocs\mts\library\Zend\Cache.php:208 Stack trace: #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\library\Zend\Application\Bootstrap\Boots in C:\xampp\htdocs\mts\library\Zend\Cache.php on line 208

like image 827
Rene Avatar asked Jan 23 '12 21:01

Rene


1 Answers

Setting the cache in bootstrap

  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);
    }
like image 166
coolguy Avatar answered Sep 20 '22 23:09

coolguy