Qbasicnews.com

Full Version: Apache won't let me write to the disk
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
PHP file commands turn up errors.
I'm using PHP 4.3x and Apache 2 on Linux.
Any help?
Could you be more specific? Did you set the permissions correctly on the parent directory?
What permissions? In the httpd.conf file? Or in the php.ini file?
File uploads of any type, and php's file processing commands don't work - turn up this error:
move_uploaded_file(files/file.zip): failed to open stream: Permission denied in /var/www/html/upload.php on line 21
I did chmod 777 to my html dir - it worked!
thats dangerous! change your permissions to 755 instead.
Ok
755 prevents uploading! 775 prevents it as well! Hmm....is 777 all that dangerous?
Would a upload directory with the permissions 777 be safe? Could a casual visitor *actually* delete my files?
No, unless they uploaded a php script. Again, a huge security hole - you should code your script to delete any script that doesn't have an "accepted" extension (for example, the one at QBNZ denies any file without the extensions .txt, .bas, .zip or .rar).
Quote:Would a upload directory with the permissions 777 be safe? Could a casual visitor *actually* delete my files?

you can do uploads without having 777 permissions on the /var/www/html folder. You just have to put a folder outside it specifically for uploads.

oracle, a .cgi or a .pl script is even more dangerous. Some Linux kernels have a really dumb vulnerability. A code of about 15 lines can crash the Linux kernel. So uploading such scripts is even more risky =P.
Pages: 1 2