this is an article i wrote on how i was able to fix this error i was getting. the error was Warning: copy(directory/path/picture.gif) [function.copy]: failed to open stream: Permission denied
Warning: copy(directory/path/picture.gif) [function.copy]: failed to open stream: Permission denied in /var/www/html/web/images/image.php on line 8
If you are breaking your head trying to figure out what this error is all about, then hopefully you can learn from this tutorial guide post on how to fix this problem with your website.
I spend alot of time trying to figure out this problem. I will show you some steps on how to troubleshoot this annoying problem if you get stuck on the apache or IIS error. I am not sure if this will work on IIS, I have tested these on LINUX apache server, so here we go.
step1. The abvious is to check to make sure you don't have a mispelled word in your code. check to make sure that you have all your variables spelled correctly,
step2. Check your code again. Sorry, but you must double check your code. In my example, its giving me an error on line 8, so check line eight, make sure that you have all the code. A good trick to this is to rewirte that little peace of code where the copy() function is and copy and paste it to your script. you'll be amazed.
step3. if you did step1 and step2, then your next step is to make sure you have the directory with the proper permissions of 777. Linux wants to write to this directory, so you need to give it permission to write (add files) to it. use your favorite ftp and change it. if you don't have a ftp application, you can ssh to the shell and exectuce this command:
chmod 777 directory/path/filename.php
try uploading the image again or the file you are trying to upload.