Permissions problem

LionRock

Verified User
Joined
Mar 30, 2007
Messages
95
Hi,

when I upload files via ftp they get permissions user:apache. Everything works but php cant write files/dir. If I chmod it to 775, still the same. If I change ownership to username:username, still the same. But when I change it to apache:username, then its ok. Why this does not work when ownership is username:username?
 
when I upload files via ftp they get permissions user:apache

Something is wrong. Should be user:user if doing it through ftp.

If I chmod it to 775, still the same.

If should work if the directory you are uploading to is chmod 775. But again neither one of these is correct behavior by default.

If I change ownership to username:username

php will not be able to write to the directory because it runs as apache. But all this changes if you run suphp or run php as a cgi. Then it will run as the owner.
 
I'm using suphp and also php runs in cgi mode. So, what should I do that when I add new account and when user uploads some files that this will work as it should? Have I missed something? Because A lot of customers calls because of that and its annoying :)
 
I'm using suphp and also php runs in cgi mode.

I don't think you can do both unless you have two different version of php, one for suphp and one for cgi.

The default install of proftpd uploads files owned by user:user. If ftp is not doing that then that means you have changed something in the proftpd configuration.
 
Back
Top