How do I write to a group-writable directory?
Posted: Wed Sep 19, 2007 3:13 pm
I am trying to make a script to write files to a directory with the CHMOD of 0775. When I created the directory using an FTP program and uploded the script, both the script and the directory have the same exact user and group. However, the script runs as a different user and group (ie. probably the apache server or www or somesuch. I have the UserID and GroupID of what it runs as, which is not the userID and GroupID that the script is saved on the server as).
However, when I try to write a file to the directory, I get an error in the browser that permission is denied.
I can, however, write to the directory if the CHMOD is 0777. But I do not want to open the directory up to the public like this.
I haven't got access to the server-side configurations. So I have to do things strictly in PHP for this particular task. Safe Mode is ON on this particular server.
Does anyone know of php code that lets me write to a directory that is owner+group-writeable only?
However, when I try to write a file to the directory, I get an error in the browser that permission is denied.
I can, however, write to the directory if the CHMOD is 0777. But I do not want to open the directory up to the public like this.
I haven't got access to the server-side configurations. So I have to do things strictly in PHP for this particular task. Safe Mode is ON on this particular server.
Does anyone know of php code that lets me write to a directory that is owner+group-writeable only?