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.
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).
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.