Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

‘cache_dir must be a directory’
 
rickystra
Jr. Member
 
Total Posts:  30
Joined:  2009-04-24
 

Hello,
i have a magento multistore on the same domain.
Every 15 min i receive an email with this error:

Fatal error: Uncaught exception ‘Zend_Cache_Exception’ with message ‘cache_dir must be a directory’ in /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache.php:209
Stack trace:
#0 /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache/Backend/File.php(154): Zend_Cache::throwException(’cache_dir must ...’)
#1 /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache/Backend/File.php(121): Zend_Cache_Backend_File->setCacheDir(’/var/www/vhosts...’)
#2 /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache.php(153): Zend_Cache_Backend_File->__construct(Array)
#3 /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache.php(94): Zend_Cache::_makeBackend(’File’, Array, true, true)
#4 /var/www/vhosts/strabello.eu/httpdocs/app/code/core/Mage/Core/Model/Cache.php(117): Zend_Cache::factory(’Varien_Cache_Co...’, ‘File’, Array, Array, true, true, true)
#5 /var/www/vhosts/strabello.eu/httpdocs/app/code/core/Mage/Core/Model/Config.php(1254): Mage_Core_Model_Cache->__construct(Array)
#6 /var/www/vhosts/strabello.eu/httpdocs/app/Mage.php(432): Mage_Co in /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache.php on line 209

Can you help me?

Thank

 
Magento Community Magento Community
Magento Community
Magento Community
 
kandrew
Sr. Member
 
Total Posts:  114
Joined:  2011-02-28
 

Which magento version you are running?

 
Magento Community Magento Community
Magento Community
Magento Community
 
rickystra
Jr. Member
 
Total Posts:  30
Joined:  2009-04-24
 

1.5.1.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
kandrew
Sr. Member
 
Total Posts:  114
Joined:  2011-02-28
 

Probably the issue is that Magento can’t write to var/cache directory or this directory isn’t exist.
Also it seems that Magento Forum crashed the stack trace that you posted here.
Can you either send it to me as PM or repost it here (but check that it will be displayed correctly)?

 
Magento Community Magento Community
Magento Community
Magento Community
 
rickystra
Jr. Member
 
Total Posts:  30
Joined:  2009-04-24
 

var/cache exist and file permissions are 777

I have 2 website on the same domain, every website have 2 store and every store have 5 store view

Fatal errorUncaught exception 'Zend_Cache_Exception' with message 'cache_dir must be a directory' in /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache.php:209
Stack trace
:
#0 /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache/Backend/File.php(154): Zend_Cache::throwException('cache_dir must ...')
#1 /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache/Backend/File.php(121): Zend_Cache_Backend_File->setCacheDir('/var/www/vhosts...')
#2 /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache.php(153): Zend_Cache_Backend_File->__construct(Array)
#3 /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache.php(94): Zend_Cache::_makeBackend('File', Array, true, true)
#4 /var/www/vhosts/strabello.eu/httpdocs/app/code/core/Mage/Core/Model/Cache.php(117): Zend_Cache::factory('Varien_Cache_Co...', 'File', Array, Array, true, true, true)
#5 /var/www/vhosts/strabello.eu/httpdocs/app/code/core/Mage/Core/Model/Config.php(1254): Mage_Core_Model_Cache->__construct(Array)
#6 /var/www/vhosts/strabello.eu/httpdocs/app/Mage.php(432): Mage_Co in /var/www/vhosts/strabello.eu/httpdocs/lib/Zend/Cache.php on line 209
 
Magento Community Magento Community
Magento Community
Magento Community
 
mgt_commerce
Member
 
Avatar
Total Posts:  66
Joined:  2009-06-06
 

What happens if your delete the “cache” directory?
Magento should be able to create the directory with enough permissions von var/*

best regards,
stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
SimpleHelixcom
Enthusiast
 
Avatar
Total Posts:  906
Joined:  2007-08-31
Huntsville, AL
 

Hello,

Check var/report for this specific error and paste the entire stack trace. Somewhere in there it should be complaining about the actual problem. Sometimes we’ve seen it complain about there being no /var/tmp folder on the root of the server.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rickystra
Jr. Member
 
Total Posts:  30
Joined:  2009-04-24
 

I create /tmp and /var/tmp folder, but error there is again, always. In that folder no file are created.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

When you delete the /var/cache folder is it getting recreated? Who owns it once it is recreated?

 
Magento Community Magento Community
Magento Community
Magento Community
 
deliciousmint
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2008-03-11
Auckland, New Zealand
 

I know this is an older post, but for anyone with the same issue on a multi store site, creating a folder named tmp in the folder for each store should fix it (or creating symlinks to a tmp folder in the root directory should work too).

 
Magento Community Magento Community
Magento Community
Magento Community
 
kevinblack
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2011-05-10
 

Go to file : lib / Zend / Cache / Backend / File.php

line 91 :

OLD : ‘cache_dir’ => ‘tmp/’,

=> Change it to : ‘cache_dir’ => null,

Fixed. LOL

If have any question u can email to me :

http://www.magentocommerce.com/magento-connect/developer/kevinblack#developer-view:extensions

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top