I don't think there is a way for you to run the script as the user requesting the page (at least not with Apache). I don't know how that would help you, anyway; unless you make the directories accessable to "public" (since you don't know in advance who will be accessing the pages/scripts).
Incoming page requests don't log on to your server, so they don't have a "user id" anyway. Even if you secure directories with .htaccess or some such security, the requests still are not really logged on and so still don't have a "user id".
I think it would be better to run your server as one particular user and make sure your directories are accessable only to that user id.
-- Rich Rijnders
-- Irvine, CA US