title: Zend Cache Exception: 'cache_dir "/home/(...)/application/../data/tmp/" is not writable'
body: <p>I'm <strong>really</strong> new to Zend, few days of use. </p>
  
  <p>I'm getting a fatal error message:</p>
  
  <pre>
  Fatal error:  Uncaught exception 'Zend_Cache_Exception' with message 'cache_dir "/home/[REDACTED]/application/../data/tmp/" is not writable' in /home/[REDACTED]/library/Zend/Cache.php:209
  Stack trace:
  #0 /home/[REDACTED]/library/Zend/Cache/Backend/File.php(181): Zend_Cache::throwException('cache_dir "/hom...')
  #1 /home/[REDACTED]/library/Zend/Cache/Backend/File.php(129): Zend_Cache_Backend_File->setCacheDir('/home/user/Proj...')
  #2 /home/[REDACTED]/library/Zend/Cache.php(153): Zend_Cache_Backend_File->__construct(Array)
  #3 /home/[REDACTED]/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('File', Array, false, false)
  #4 /home/[REDACTED]/application/Bootstrap.php(42): Zend_Cache::factory('Core', 'File', Array, Array)
  #5 /home/[REDACTED]/library/Zend/Application/Bootstrap/BootstrapAbstract.php(669): Bootstrap->_initCache()
  #6 /home/[REDACTED]/library/Zend/Applica in /home/[REDACTED]/library/Zend/Cache.php on line 209
  </pre>
  
  <p>According to the error message, I would expect a folder permissions issue on the <code>tmp</code> directory. The directory is, however, writable:</p>
  
  <pre>
  user@[REDATCED]:~/[REDATCED]/data$ ls -hal
  total 24K
  drwxrwxr-x  6 user user 4,0K Jan  7 18:40 .
  drwxr-xr-x 12 user user 4,0K Jan  9 12:50 ..
  drwxrwxr-x  3 user user 4,0K Dez 17 11:42 locales
  drwxrwxr-x  2 user user 4,0K Dez 17 11:42 logs
  drwxrwxr-x  2 user user 4,0K Dez 17 11:42 sessions
  drwxrwxr-x  2 user user 4,0K Jan  7 18:40 tmp
  </pre>
  
  <p>The workaround is to comment the following lines on <code>application/Bootstrap.php</code>:</p>
  
  <pre>
      protected function _initCache() {
            $frontendOptions = array(
                'lifetime' => 7200, // cache lifetime of 2 hours
                'automatic_serialization' => true
            );
  
            $backendOptions = array(
                'cache_dir' => APPLICATION_PATH . '/../data/tmp/' // Directory where
            );
  
            // getting a Zend_Cache_Core object
            $this->cache = Zend_Cache::factory('Core', 'File',
              $frontendOptions, $backendOptions);
  
            Zend_Registry::set('cache', $this->cache);
  
            Zend_Date::setOptions(array(
                'cache' => $this->cache
            ));
  </pre>
  
  <p>This workaround was suggested by a coworker, I have no idea what I'm doing here or even if this code is part of Zend or our codebase. I don't like ugly hacks, or "fixing" stuff by commenting out code, or doing anything without knowing what I'm doing, or the reason behind it.</p>
  
  <p>Besides, the code seems to be working on my coworkers' machines. And every time I pull their code commits from the repository I get an uncommented copy anyway.</p>
  
  <p>I probably could exclude the file from the repository or anything like that (I'm new to git as well), but I really prefer:</p>
  
  <ul>
  <li>Knowing the cause for the error</li>
  <li>Knowing the solution</li>
  </ul>