title: Chmod 666 and access denied for getimagesize
body: <p>First of all, this is not a duplicate of : <a href="https://stackoverflow.com/questions/7799478/permission-denied-on-getimagesize">Permission denied on getimagesize</a></p>
  
  <p>I got following code, where I sat an <code>chmod</code> for the image, and then I wan't to get it's size.</p>
  
  <pre><code>@chmod($path."/".$filename, '0666');
  getimagesize($path . "/" . $filename);
  </code></pre>
  
  <p>But if I set a chmod, I'm receiving this error message: </p>
  
  <blockquote>
    <p>failed to open stream: Permission denied in[...]</p>
  </blockquote>
  
  <p>What is the problem? All files and the directory has the same group and owner - <code>www-data</code>.</p>