PHP upload error: Permission Denied
Posted: 19 Aug 2010, 09:25
I've coded a php page to upload. Upon testing, it worked fine, I could use it to upload document to both localhost (not an achievement of note) and a locally hosted webserver.
Now we've recently been getting a problem:
So I went googling. My first thoughts were folder permissions, and google confirmed this. So I did the following commands and tried again:
Yet, I still get that error. Does anyone know what I am missing.
Now we've recently been getting a problem:
Code: Select all
Warning: move_uploaded_file(../qms/procedures/1_quality/VCE-SOPQMS-01-07 - Control of Non-conformity.pdf) [function.move-uploaded-file]: failed to open stream: Permission denied in /var/www/qms/upload_file.php on line 19
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpWRVGGA' to '../qms/procedures/1_quality/VCE-SOPQMS-01-07 - Control of Non-conformity.pdf' in /var/www/qms/upload_file.php on line 19
Warning: Cannot modify header information - headers already sent by (output started at /var/www/qms/upload_file.php:19) in /var/www/qms/upload_file.php on line 31
Code: Select all
chown www-data /var/www/
chgrp www-data /var/www/
chmod 777 /var/www/