PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I get two warnings when attempting to upload a file to the images directory in the DocumentRoot for a virtual host in Apache2:
Warning: move_uploaded_file(/home/vsftpd/nameofsite/www/images/icon1.gif) [function.move-uploaded-file]: Failed to open stream: Permission denied...
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php6oPKJ2' to '/home/vsftpd/nameofsite/www/images/icon1.gif'...Error: could not move file to destination directory
The DocumentRoot is set to /home/vsftpd/nameofsite/www.
I have searched for information on the permission errors and how to avoid them but keep going round in circles. Any help on this much appreciated.
Thank you for the reply - your suggestion worked! Much appreciated.
My only concern now is the security implications of chmod 0777. Does this mean that anyone can upload anything to the images directory, or is the upload restricted to only those users who have access to the php upload script (ie by logging into the website as administrator)? Bit hazy on this...