Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Essentially i found out you can limit the folders each user has access to by using php's basedir/open_basedir.

I'd like to have each php only access its own files. So i wrote

fastcgi_param  open_basedir       $document_root;

in hopes that it would work. It didnt. I googled and only found results saying you cant do it via fastcgi or nginx.

Is this true or can i not do it?

PS: I -do- spawn php as its own user (rather then www-data) so it doesnt wreak havoc on my nonphp websites. But i still like to prevent one php script on a php site from accessing other directories (if i have a wordpress install on its pretty obvious a valid php path is /var/www/yourface/<wordpress scripts>

share|improve this question
up vote 1 down vote accepted

In recent versions of php, ini values can be set over fastcgi. See for details.

share|improve this answer
This doesnt appear to work. I'm using version 5.3.3. The current stable is 5.3 – acidzombie24 Nov 14 '11 at 4:17
The comments on the php bug say that it should be working in 5.3.3. What's the line you added to nginx.conf? Are you using fpm? – kolbyjack Nov 14 '11 at 12:13
ah ha. I was using php-fastcgi instead of fpm. I always thought fpm is for apache. So my config line was correct! (which i got from your answer link). Thanks! – acidzombie24 Nov 14 '11 at 13:47

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.