If you're doing this through Apache, you're gonna get Apache's UID/GID/umask.
If you run PHP via cgi, and suexec, etc., you might be able to do what you want, but you are INVITING DISASTER!! (Please, please, please don't do this! 🙂 )
One viable alternative: if you own the server, create a cronjob running as a suitably enabled user, that looks for the dirs and does the changing itself....