[H-GEN] finding which user executes a script

Jason Parker-Burlingham jasonp at uq.net.au
Wed May 14 08:06:44 EDT 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

"Greg Fairbrother" <greg at greg.hm> writes:

> Sorry if this is a dum question, but how do I find out what user is
> executing a php script, It's to do with my previous post about php and file
> uploading,

My advice would be to write a small PHP script that prints a message
saying "this script was run by <...>" where the brackets are replaced
by the result of whichever function you call in PHP to find out the
userid of the process.

> if I know what user is executing the php script (eg. apache or
> nobody) then I could add them to the group who owns the directory,
> and just give that group write permissions?

I would recommend giving things a lot more thought.  That may be
enough, but you could be opening a huge can of worms, too.
-- 
``Oooh!  A gingerbread house!  Hansel and Gretel are set for life!''

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list