Could not determine temp directory, please specify a cache_dir manually problem in Magento



After moving a Magento store from one hosting to another, Magento admin shows exception: "Could not determine temp directory, please specify a cache_dir manually". This is usually due to the Shared web hosting but our hosting was not the Shared, Here in this post I am describing how to solve this problem either on the Shared or on the VPS, it is very easy and you can solve just by following the steps given below:

Step 1: Check the Folder permission for the cache directory, if it is not the 777 Please apply the 777 permission to the var/cache folder, Just by using the SSH
Command below:

sudo chmod 777 var/cache* -R

Want to read more : Change File/Folder Permission,Owner/Group Permission Through The Terminal In Linux/Ubuntu

Step 2: Delete the Magento Cache Manually just by deleting the var/cache folder.

Step 3: Now Refresh the website and check the var/cache, Magento creates this folder again and check the permission of this newly created folder, if it is 777 then it is fine otherwise use the Step 1 and reset the permission to this folder. Hope it solve the problem, if the problem is still there:

Step 4: Navigate to the /lib/Zend/Cache/Backend/File.php and copy the File.php and create the folder app/code/local/Zend/Cache/Backend/File.php, as we know File.php is the Core Magento file and we suggest everytime not to change the Magento Core Files so that I have putted it into the app/code/local folder, now it will not affect the Magento Version Upgrade.

Step 5: Open the File.php and search for the ‘cache_dir’ => null, and change it ‘cache_dir’ => “var/tmp/”,

Step 6: Now refresh the browser cache and Magento cache as well, hope it solve the problem.

Hope it helps and you enjoyed reading, if you need the professional Magento Development we can help you, just Click on the Link and send me your requirements.

Please Like the Post on Facebook or Google+.