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