httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zac Stevens <>
Subject Re: Running phpscript with UID
Date Fri, 09 Aug 2002 14:31:08 GMT
Hi Daniel,

On Fri, Aug 09, 2002 at 04:22:19PM +0200, Daniel Nolte wrote:
> I want that phpscript get executed with the userid
> of the owner of the file or if that's easier with the uid I define
> in "VirutalHost". I tried suexec, but suexec needs for every
> user an own php-binary, since it checks who owns this binary.
> Is there a better/easier way? 

Unfortunately no - to do what you need requires using the PHP CGI binary,
and suexec.  This is because of the way the unix privilege system work, as
it isn't possible for a program to securely change its privileges in a
reversable way.

One variation worth investigating is running PHP as a FastCGI binary.  This
keeps a persistant copy of PHP running as an external program which the
httpd talks to.  I believe it would be possible to run the FastCGI binary
as different users and have one copy running for each VirtualHost requiring
this feature.

Each of these has its downsides - CGI in terms of per-request overheads
incurred in startup; FastCGI in requiring sufficient resources to run many
PHP interpreters, whether or not they're being used.

> Does Apache 2.x has a feature for this problem?

Something in the works for Apache 2 is the 'perchild' MPM, which allows you
to run children as a specific user and only direct a single VirtualHost to
it.  While this would do what you want, this MPM is not usable at the
present time.

Hope that helps,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message