Link to home
Start Free TrialLog in
Avatar of mikely
mikely

asked on

Change permission of http uploaded file FROM www using PHP chmod function on FreeBSD

Files uploaded via http and moved via a PHP script are currently given the owner www:www.

I need these files to belong to a different user so they count towards their file quota and not toward www's.

I intend to use PHP's chmod function to change the owner but I appreciate that without some changing of privileges on the server this will not be possible.

The server is running FreeBSD. I have root access. What permissions do I need to add/change on the server to allow PHP, running as www, to change the owner of files belonging to www:www?
Avatar of Twisteddk
Twisteddk

Offhand, the user/program executing the change need to be a part of the group www and the file must have +w permissions set for the group, then it should work.
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can make shid directory and use umask 0007 inside php, so you have special group where to add users to write web files.
Avatar of mikely

ASKER

It wasn't so much a solution as telling me what I was trying wouldn't work but offering no suggestion of how I might otherwise achieve the same affect.