[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] PHP script



-----Original Message-----
From: Andy Clyde, oxfordmusic.net [mailto:cobalt-users@xxxxxxxxxxxxxxx]
Sent: Friday, May 30, 2003 8:49 AM
To: Cobalt Users
Subject: [cobalt-users] PHP script


a quickie, not especially cobalt relevant but i can't find the answer
anywhere!

how do i find out what user is running a php script?

the reason i ask is that one of my clients is having trouble running a shell
command via a php script. he can do via a cgi php script but not via the
apache module. i have safe mode enabled but i am not getting a safe mode
warning.

cheers

andy
_____________________________________


Andy,

PHP will run as the user who APACHE runs as.  The ONLY way around that
is to use the PHP executable instead.  So, you would need to make a new
extension in your httpd.conf ( or remove the libphp4.so line ), and make
the user have this in the TOP of my every page.

#!/<path_to_php/php

Just like PERL does.  That is why in PERL, you can make it run as root,
where
as in PHP, it will run as HTTPD (or nobody on a normal Linux box).

Thanks,

Brian