title: Permission denied warning with function.file-put-contents
body: <p>I'm using this code to download a dynamic image file which is already on my server</p>
  
  <pre><code>$url = 'example.com/test/image.php';
  $img = 'cert.png';
  file_put_contents($img,'file_get_contents($url));
  </code></pre>
  
  <p>allow_url_fopen is already enabled on the server. but i'm still getting the following error</p>
  
  <pre><code>Warning: file_put_contents(cert.png) [function.file-put-contents]: failed 
  to open stream: Permission denied in D:/... on line 42
  </code></pre>
  
  <p>I saw the same error on another website <a href="http://www.rsi-relief.com/rsi-links/ergonomics-information/ergoweb/" rel="nofollow">http://www.rsi-relief.com/rsi-links/ergonomics-information/ergoweb/</a></p>
  
  <p>I'm new to PHP so i'm a bit confused here. Pls help</p>