Re: [PHP-DB] Re: www-data file

[email protected] (Matt Pelmear) Tue, 26 Aug 2014 08:26:14 -0700
Newsgroups php.db
Message-ID <[email protected]>
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.)