View Full Version : group apache uses
07-15-2007, 10:39 PM
Is there some php way to find the croup that apache is running as? I know that it is usually 'apache' but the script I am writing needs to work on multiple stations that I dont know the specs of.
07-16-2007, 12:05 AM
nobody/apache/www-data/www/httpd ... so many common ones + all the uncommon ones people use for different reasons.
If this was dynamic you could create a file which should have the user and group ownership of the webserver and then grab the uid and gid from stat() ?
07-16-2007, 12:14 AM
well isnt that just for files? I need it to find the httpd process group so that I can chgrp to be able to edit files, but this program will be redistributed so I need it to find out the group.
example: On my system, I have the install script just change the group and use a minimal chmod, but the original user will still be able to edit the files. On my server the group is apache but I need some way to find it on other systems.
ralph l mayo
07-16-2007, 04:34 AM
posix_getegid() gets the effective group id and you can get more info about it including the short name with posix_grgrgid($egid)
07-16-2007, 03:01 PM
well isnt that just for files? I need it to find the httpd process group so that I can chgrp to be able to edit files -Adam
yes it is, thats the point, in your setup routine have apache create a file, then check its uid and gid, you would have to do this at runtime.
07-16-2007, 05:25 PM
Haha I didnt think of that... (Post time: "07-16-2007, 12:14 AM"). Ok It works great thanks.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.