title: imagejpeg - Unable to open file for writing: Permission denied
body: <p>I am getting this error / warning:</p>
  
  <blockquote>
    <p>Warning: imagejpeg(): Unable to open
    '/var/www/my_web/data/my_web/www/users/avatars/user125.jpg' for
    writing: Permission denied in
    /var/www/my_web/data/classes/class.Image.php on line 157</p>
  </blockquote>
  
  <p>On line 157, there is </p>
  
  <pre><code>  imageJPEG($image, $this-&gt;destPath, $this-&gt;jpgQuality);
  </code></pre>
  
  <p>My avatars folder has permission set to 777, <code>$this-&gt;destPath</code> is <code>'/var/www/my_web/data/my_web/www/users/avatars/user125.jpg'</code></p>
  
  <p>How could I solve this problem?</p>