owner and group permissions/php file upload

nhwebgroup

Verified User
Joined
Aug 8, 2005
Messages
24
Location
nh
I have a PHP script the uploads a file from the browser to a specific folder on the website using the PHP function move_uploaded_file (http://us2.php.net/manual/en/function.move-uploaded-file.php)

I currently have the perms set for the folder and all files set to
-rwxr-xr-x 1 apache apache 85 Jan 20 10:53 test.gif

the problem is if i login with FTP i can not upload/overwrite the files because i don't have permission
So if i change the perms to
-rwxr-xr-x 1 admin apache 85 Jan 20 10:53 test.gif
or
-rwxr-xr-x 1 admin admin 85 Jan 20 10:53 test.gif
then the PHP upload script does not work.. i get a permission denied

So what should the perms be? to make both FTP and the PHP script work?
 
You can try chmodding it to 666 or chowning it to apache:<username> and chmodding it to 660. Only need it to be at 666 for chmod because gif files dont need to be executed, just read/write.
 
Back
Top