Re: Re: www-data file

From: Date: Tue, 26 Aug 2014 15:26:14 +0000
Subject: Re: Re: www-data file
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-48904@lists.php.net to get a copy of this message
On 08/26/2014 06:21 AM, Jim Giner wrote:
On 8/26/2014 12:20 AM, Ethan Rosenberg wrote:
Dear list - When I use fopen, the file owner and group are both www-data. How can I ensure that the owner and group will be ethan? TIA Ethan
Why should ownership be a concern when you are simply opening a file? AFAIK permissions are set at the time the file is placed there and will affect the access to them from then on. If you are able to fopen the file, why do the permissions matter? If you can't then you have an entirely different problem to discuss.
fopen() can create files if they don't exist. So if you open a file for writing, it will by default receive the user/group of the web server. If you then need to access the file as some other user, you run into this situation. (I assume this is what Ethan is referring to here.)

« previous php.db (#48904) next »