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

Page 1 of 3
Could not determine temp directory, please specify a cache_dir manually
 
alienn95
Member
 
Total Posts:  38
Joined:  2009-02-05
Latvia
 

cache problem after installation. Any link in Admin panel gives a report starting with:

“Could not determine temp directory, please specify a cache_dir manually”

Magento version magento-1.4.0.0-alpha3

Installed on subdomain.

What could be the problem and how to solve it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
wsp
Jr. Member
 
Total Posts:  6
Joined:  2008-04-15
 

the same problem here.... :.-(

 
Magento Community Magento Community
Magento Community
Magento Community
 
JMJ Development
Member
 
Avatar
Total Posts:  40
Joined:  2008-08-07
Australia
 

Hi,

If you are still having issues with this try creating a new dir called tmp.

Navigate to app/code/core/Zend/Cache/Backend/

Edit File.php

Change:

protected $_options = array(
        
'cache_dir' => 'null',

to

protected $_options = array(
        
'cache_dir' => 'tmp/',

For Magento Version 1.4.1.0

Navigate to lib/Zend/Cache/Backend/

Edit File.php

Change:

protected $_options = array(
        
'cache_dir' => null,

to

protected $_options = array(
        
'cache_dir' => 'tmp/',

This worked for me.

Hope it helps.

Regards,

Jack

 
Magento Community Magento Community
Magento Community
Magento Community
 
wsp
Jr. Member
 
Total Posts:  6
Joined:  2008-04-15
 

Great.... the right place to change!

for me works this:

protected $_options = array(
‘cache_dir’ => ‘/tmp’,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Melchior5
Member
 
Total Posts:  49
Joined:  2009-03-25
Montréal, Québec
 
wsp - 17 November 2009 12:51 AM

Great.... the right place to change!

for me works this:

protected $_options = array(
‘cache_dir’ => ‘/tmp’,

Thanks WSP
I was trying to install 1.4.0.0 RC1 and this patch saved me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zpy1
Jr. Member
 
Total Posts:  2
Joined:  2009-10-19
 

i have the same problem! but i dont have such a file and even not such a folder… maybee it has changed within 1.4.0.1?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Timo Helken
Jr. Member
 
Total Posts:  1
Joined:  2010-02-18
 

Hey zpy1,
I had the same problem.
You have to open magento/lib/Zend/Cache/Backend/File.php
Change:

protected $_options = array(
        
'cache_dir' => 'null',

to

protected $_options = array(
        
'cache_dir' => 'tmp/',

Upload the changed File.php and create a folder, called “tmp”
The folder must be writable, so give it ‘777’

That worked fine for me, hope it helps you.

Best wishes,
Timo

 
Magento Community Magento Community
Magento Community
Magento Community
 
pmontier26
Jr. Member
 
Total Posts:  5
Joined:  2010-02-25
 

It’s unbelievalbe to get such fatal error

there are NO lines like :

protected $_options = array(
‘cache_dir’ => ‘null’,

in magento/lib/Zend/Cache/Backend/File.php for the 1.4.0.1 release

Is Someone has a solution ??

 
Magento Community Magento Community
Magento Community
Magento Community
 
perymgael
Jr. Member
 
Total Posts:  1
Joined:  2010-02-08
 
Timo Helken - 25 February 2010 05:38 AM

Hey zpy1,
I had the same problem.
You have to open magento/lib/Zend/Cache/Backend/File.php
Change:

protected $_options = array(
        
'cache_dir' => 'null',

to

protected $_options = array(
        
'cache_dir' => 'tmp/',

Upload the changed File.php and create a folder, called “tmp”
The folder must be writable, so give it ‘777’

That worked fine for me, hope it helps you.

Best wishes,
Timo

worked for me… create tmp in the main magento folder.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MwDesign
Jr. Member
 
Total Posts:  8
Joined:  2009-10-24
 

Hello everyone,
thanks to this debate, I solved the problem .. thanks so much!
It happened to me this error when updating my dedicated server with the new versions of:

- Apache 2.3.3
- MySQL Server 5.0.32
- PHP 5.2.0-8

I hope it is useful to someone if they are still found this error.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Piedro
Jr. Member
 
Total Posts:  14
Joined:  2008-03-30
 

PLZ! HELP!

I don’t have the mentioned folder at all!

within

“app/code/core/Zend/”

I don’t have ANY folder just a file called “mime.php”

What to do?

plz, help,
thx,
piedro

p.s.: upgraded from 1.3.2 via downloader to 1.4.0.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
devkitchen
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2009-06-19
Germany, Nuremberg
 

Hi,

look at /lib/Zend/Cache/Backend/File.php, LINE 91

best regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
FerdiUSA
Jr. Member
 
Total Posts:  8
Joined:  2009-04-11
 

Instead of editing files of the Zend Framework, you could as well set a proper “upload_tmp_dir” in the php.ini!

E.g. by creating a php.ini in the magento base dir with

upload_tmp_dir "/absolut/path/to/tmp/dir/with/slash/"

remember to put a slash at the end of the path!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Júnior
Jr. Member
 
Total Posts:  1
Joined:  2010-06-09
 

The solution propose by Aero Database works perfect for me.
Thanks Aero.
I really have a bad time configuring this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paul Whipp
Member
 
Total Posts:  48
Joined:  2009-03-23
 

Thanks for these posts!

This problem has affected me after upgrading to 1.4.1 from 1.4.0.1 - everything was fine before the upgrade.

Creating my own tmp folder and pointing the code at it deals with the problem, albeit with a change to the core code which I’m not happy with (I fear it will come back to bit me in future).

Does anyone know why it happened?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tuppi Sau
Member
 
Total Posts:  34
Joined:  2010-01-18
 

This fix is specially for magento ce 1.4.1.0, for other magento version it may or may not be applicable:

This error is caused because the magento is unable to find the temporary directory at the server:

Use following code to find if there is temp folder assigned to server:

<pre>
<?php
    
//var_dump($_ENV);
    //var_dump($_SERVER);
    
foreach (array($_ENV$_SERVER) as $tab){
        
foreach (array('TMPDIR''TEMP''TMP''windir''SystemRoot') as $key{
            
if (isset($tab[$key])) {
                
if (($key == 'windir') or ($key == 'SystemRoot')) {
                    $dir 
realpath($tab[$key] '\\temp');
                
else {
                    $dir 
realpath($tab[$key]);
                
}
                
if (is_readable($dir)) {
                    
if (is_writable($dir)) {
                        
echo $dir;
                    
}
                }
            }
        }
    }
?>
</pre>

if the above code returns some value, then this fix won’t work for you.

if it returns nothing then proceed with following steps:
1. Create a ‘tmp’ directory at [Magento Directory]/var/
2. Give 0777 permission to ‘tmp’
3. Go to: [Magento Directory]/lib/Zend/Cache/
4. Open file Backend.php
5. Find this line “if ($this->_isGoodTmpDir(’\\temp’)) “ around line 194
6. After closing if put following

else{
    
return 'var/tmp/';
}
7. Save file
8. That’s it, go and enjoy and start finding other issues, exceptions and bugs, because Magento consists of never ending bugs.
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 3