Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running into a problem where trying to set open_basedir dynamically under nginx (and apache) for php-fpm is "bleeding through" to other vhosts when running php-fpm as user "nobody" (for legacy reasons).


fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/mike/htdocs";


fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/adam/htdocs";

etc. where appropriate for each virtual host (php 5.3.20)

phpinfo shows the correct open_basedir being set, but eventually (rather quickly) I start to get errors thrown where one of the virtual hosts will run into the wrong open_basedir, trying to execute a program for "mike" but having the open_basedir for "adam".

Since fastcgi_param is just basically setting the environment for php-fpm, what I think is happening is the same worker will get it's environment changed while it's still processing a php file.

Somehow servers like litespeed which also use a fastcgi php process (running as nobody) get this right and work correctly with open_basedir being able to be set externally without "bleeding" between virtualhosts.

So I am wondering if there is a trick or workaround I can use to keep running as "nobody" and preserving the environment between vhosts.

I should note I am using unix sockets and not tcp/ip but I don't think that makes a difference.

share|improve this question

I found a mention of the same problem here:,234856

They said they were able to work around by it using the new [] directive for php.ini which was made available after 5.3

The manual shows a comment warning this does not work properly with php-fpm, but that comment is two years old and may have been resolved.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.