title: Symfony exception - directory is not writable
body: <p>I have web page based on Symfony 3 framework. Directory <code>/var</code> has set writable privilegies on web-data and root. ALL caches, sessions and logs are writted here without problem. </p>
  
  <p>Nevertheless i have still in my prod.log exceptions like this: (Path is still the same - annotations)</p>
  
  <blockquote>
    <p>[2018-07-16 13:32:31] request.CRITICAL: Exception thrown when handling
    an exception (InvalidArgumentException: The directory
    "/var/www/domain.com/var/cache/prod/annotations" is not writable. at
    /var/www/domain.com/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php
    line 92) {"exception":"[object] (InvalidArgumentException(code: 0):
    The directory \"/var/www/domain.com/var/cache/prod/annotations\" is
    not writable. at
    /var/www/domain.com/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"}
    []</p>
  </blockquote>
  
  <p>Web looks like run OK - without errors but in logs this exceptions are increasing any time...</p>
  
  <p>For test purpose i write function in controller like this:</p>
  
  <pre><code>    $directory = $this-&gt;container-&gt;getParameter('kernel.root_dir') . '/../var/cache/prod/annotations';
  
      if (is_writable($directory)) 
          echo "OK: ".$directory;
      else 
          echo "FAIL!: ".$directory;
  </code></pre>
  
  <p>If i call this function VIA BROWSER url i have OK answer...</p>