“Could not determine temp directory, please specify a cache_dir manually” after Magento is installed

October 22, 2010 10:06

After Magento is installed, you may have the error “Could not determine temp directory, please specify a cache_dir manually” when clicking on some pages in both backend and frontend. Usually it will be happened in shared web hosting, but also in individual server if the permission of tmp folder set wrong.

Many bloggers suggested to modify the core file “/lib/Zend/Cache/Backend/File.php” to fix this problem. However, it may be a trap when you upgrade your Magento. I recommend to use Magento’s override feature.

Firstly, copy “/lib/Zend/Cache/Backend/File.php” to “/app/code/local/Zend/Cache/Backend/File.php”, then in line 91:

    'cache_dir' => null,

change to

    'cache_dir' => "var/tmp/",

Of course, you can change the cache folder wherever you want, and that directory you should create yourself and change the permission to 777 if necessary.

Now, your Magento should be run smoothly.

Share

Comments are closed.