Another, safer, thing to consider would be setting a sticky bit on whatever directory the files will be in: http://computernetworkingnotes.com/managing-file-system-security/sticky-bit.html I've used sticky bits in a number of situations with multiple groups and users co-habiting environments quite nicely in the past. You'll find that simply chowning from inside php won't always work, depending on how your groups are setup. If it will be just one file (rather than an unlimited number of them created by the server), simply chown it to "ethan" manually, once. -matt On Aug 25, 2014 9:43 PM, "Aziz Saleh" <azizsaleh@xxxxxxxxx> wrote: > On Tue, Aug 26, 2014 at 12:20 AM, Ethan Rosenberg < > erosenberg@xxxxxxxxxxxxxxxxxxxx> 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 > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > Use chown/chgrp after the fact: > http://php.net/manual/en/function.chown.php > http://php.net/manual/en/function.chgrp.php > > If you want it to be ethan by default, something which I would never do or > recommend to do for obvious security reasons you will need to modify your > Apache environment variables (find where the configs are set by using grep, > for example: grep www- /etc/apache2/apache2.conf). >