Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- changing the id that PHP runs as
August 6, 2004, 5:47 pm
rate this thread
I ran a search on Google Groups but Google only brought back entries
from PHP-DEV. I'm sure this has been asked before but I can't find a
mention of it. How do you change the user name or id that PHP runs as.
Right now PHP seems to be running as either root or nobody (I can't
tell) and I want it to run using my username.
- Tim Van Wassenhove
August 7, 2004, 10:45 pm
Re: changing the id that PHP runs as
You really can't as far as PHP is concerned, once something is running
as user 'nobody' it doesn't have the "power" to switch users. From a
strictly PHP based end, you might be able to use the CGI program
combined with cgi-wrap or similiar (the set-ID bit), but.. not recommended.
There are User and Group options in Apache configuration, and I believe
they'll work on a virtual host basis, providing something similiar to
what you want, I suppose.
The reason 1 httpd runs as user root is that it's responsible for firing
off the different httpd's that run as nobody, (root is allowed to switch
So, once one become user "joeblow" it can't then turn around and
become 'nobody'. It's a UNIX security feature.
http://www.geniegate.com Custom web programming
User Management Solutions Perl / PHP / Java / UNIX