I realize there is some sort of problem with permissions on either my tmp folder or the images folder I created in the /var/www folder. I know that /var/www initially has root access. I have been following some online tutorials to try and fix this issue and have changed my permissions to who knows what over the last hour or so.
I receive this error when trying to upload a file from an HTML form using PHP/MySQL:
Warning: move_uploaded_file(images/verified-gw.gif): failed to open stream: Permission
denied in /var/www/addscore.php on line 40 Warning: move_uploaded_file(): Unable to move
'/tmp/phpla4QCP' to 'images/verified-gw.gif' in /var/www/addscore.php on line 40 cannot
move uploaded file or something beavis
So I think the permissions on either the /var/www/images folder are incorrect or the permissions on the tmp folder are root and the kernel of ubuntu is not letting the php script move from this root owned file to the images folder which has permissions of my user account to my knowledge and is in the group nobody.
I am pretty lost, any help is definitely appreciated.
Above you can see a picture of the permissions on the images folder I am trying to move the file from the tmp directory to.
Oh and here is the PHP script that fails:
if (!empty($screenshot)) {
move_uploaded_file($_FILES['screenshot']['tmp_name'], $target)
or die (' cannot move uploaded file or something beavis');
Respectfully,
user
sudo chmod 755 -R /var/www
This will give all your files and directories inside /var/www with enough read write permissions.chmod 777 -R /var/www/project/uploads
directory.