Question:
errors using a php upload script permission denied on my server.?
Thomas
2008-03-24 12:49:26 UTC
The server version is ubuntu 7.10 (gutsy-ribbon)
How is my own server denying me permission?

here is the exact error:
Warning: move_uploaded_file(upload/0317080846.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /var/www/issues/upload.php on line 88

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpOaRVAL' to 'upload/0317080846.jpg' in /var/www/issues/upload.php on line 88
Sorry, there was a problem uploading your file.
Three answers:
2008-03-24 12:55:23 UTC
You need to check folder permissions on your upload folder,



UPLOAD FOLDER Needs to be Unix 0777

RWX RWX RWX



On un*X go the folder above the upload/



EXAMPLE

If the upload folder sits in an folder off your web root, change to the root of that directory, the parent of the upload folder.



cd /usr/local/apache/htdocs/applicationname/



type:



chmod 777 upload



Review the README and INSTALL file of the application you installed, there may be other folders on which you need to check permissions.



Could be file size, there are parameters in APACHE and PHP that may require modifications. I set my php.ini to allow up to 40 mg uploads and parallel that in httpd.conf.
.
2008-03-24 19:58:21 UTC
Check your php.ini to see how much you can upload - there is a default - maybe 2 megs, and make sure you have correct permissions = I always try 777 (which is dangerous) on all folders indicated in the script. If that works I work my way down until I get permission errors.



Look on line 88 for the folder it's erroring out at.
K1ñG N3rÐ
2008-03-24 19:53:57 UTC
Make sure the file has proper permissions.... Try to chmod it if you have access to the server, and give it read and write...


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...