here's one way to do it. There might be a better way, but im not sure.
edit the php.ini file, and set auto_prepend_file to a php file, which looks like this:
At least it's an idea. It might be airtight, but it should get you started. Good luck, and let me know if you use it
<?
$php_uallowed = array("Pablo", "Admin"); //which users' php files can be run?
$php_gallowed = array("phpgroup", "Admin"); //which groups' php files can be run?
$file_owner = posix_getpwuid(fileowner($HTTP_SERVER_VARS["PATH_TRANSLATED"]));
$file_group = posix_getgrgid(filegroup($HTTP_SERVER_VARS["PATH_TRANSLATED"]));
//get the owner and group of the file being run
if (!((in_array($file_owner, $php_uallowed))||(in_array($file_group, $php_gallowed))))
die("<B>Fatal Error:</B> This user does not allowed to run php files.");
?>