ZF-6608: Problem if /tmp Dir not readable


My Serverprovider hasn't set the Variables used in Zend_Cache_Backend->getTmpDir() so the returned value is '/tmp'. This directory isn't writeable an so i get Errors -- i don't even use Zend_Cache, just wanted to use Zend_Date.

As a quickfix i added $_ENV['TMPDIR'] = session_save_path() but i think this should be fixed in Zend_Cache_Backend. Probably it could be tested if /tmp is writeable and if not use session_save_path? I don't know...


I have the same issue: Hadn't seen this issue yet although I did do a few searches.

just commited something better into SVN trunk

can you try it ?

(you have only to take the Backend.php file from SVN trunk)

Seems to work for me! But i have to mention, that there is another problem with session (Zend_Application_Resource_Session) since 1.8.1 so i don't know if it works in my normal usage -- currently i have a workaround for session management.


why you do not only use the php function "sys_get_temp_dir" and why you check if it exists ? The function is available since php 5.2.1 and zend framework version is 5.2.4 ->…

And if the systems temp dir is not writable this is a wrong configured (or crashed) system

The method I referred to in the second issue does use this method additionally. BUT: You can not only refer to this method alone as it is possible that this method does not return correct informations. This is due OS dependency. Therefor additional checks are also provided which make sure that the path can be detected even if sys_* does not work properly.

Are you sure? I could not find where the problem occurs ? And why it have to check first if the function exists ?

Zend_Cache works as a standalone component with php < 5.2 thanks to this additional test

merged into 1.8 branch

As I mentioned in ZF-6668 the getTmpDir() method fails when it decides to use the directory from the tmpname() test. The directory taken from it should be checked with _isGoodTmpDir().

just added this additionnel test into 1.8 branch and trunk (thanks)