you don't need to know all the groups on your server... just the one that your apache is running as... since that one controlls php and hence php acts with its permissions...
try a
ps -aux | grep httpd
this will find all the processes on your computer currently running that include the string httpd, which should be apache. you can modify this for whatever server you are running, perhaps BOA 🙂
the first entry ( on the left ) should be the user who ownes that process
that user is the one you should worry about
$5 says that with a default install it is either 'nobody' or 'apache'
once you know the user try:
finger <user>
or
groups <user>
'groups' will spill out something like <user> : <group> <group>
ednark : ednark wheel www
then you are in business, pick the group you want, and change the directory permissions