Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP _SERVER[“USER”] and _SERVER[“HOME”] appear from nowhere
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
vklimovs
n00b
n00b


Joined: 15 Dec 2005
Posts: 20

PostPosted: Sun Jul 18, 2010 11:19 am    Post subject: PHP _SERVER[“USER”] and _SERVER[“HOME”] appear from nowhere Reply with quote

I run PHP via FastCGI with nginx web server on Gentoo. PHP is started by spawn-fcgi script from lighttpd, which is started run as a daemon using start-stop-daemon (all using provided init scripts). Among other things, spawn-fcgi startup script cleans-up environment, so that only PATH, PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS are left when PHP is started. The exact line that is used to start PHP after variable substitution looks like that

Code:

env -i PATH=/lib/rc/sbin:/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin PHP_FCGI_CHILDREN=5 PHP_FCGI_MAX_REQUESTS=500 /sbin/start-stop-daemon --start --pidfile /var/run/spawn-fcgi/php-1.pid --exec /usr/bin/spawn-fcgi --name /usr/bin/php-cgi -- -a 127.0.0.1 -p 9000 -P /var/run/spawn-fcgi/php-1.pid -u nobody -g nobody -- /usr/bin/php-cgi


However on my machine, additionally to those variables, in PHP _SERVER global I also see USER and HOME variables. Not only they are there, but they are also set to "root" and "/root" respectively, which is wrong as PHP is run as user "nobody" (confirmed using echo exec('whoami');). What is wrong with my install? How can I get rid of those variables that should not be there?

As a weird addition to all that, on another machine that is amd64, with exact same package setup variables are correct! Only PATH, PHP_FCGI_CHILDREN, PHP_FCGI_MAX_REQUESTS are set, no HOME or USER.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum