Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using Debian Squeeze and set up PHP-FPM with fastcgi. I have several virtual hosts defined on the same host. I defined chroot for each pool configuration but somehow it is possible to change directory and go above the root directory definition at the pool conf.

disable_functions at the conf file is not working as well. I haven't figured it out the reason.

Samle files are below:



user = foo
group = foo

listen =
listen.allowed_clients =

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

chroot = /var/www/foo
chdir = /

php_admin_value[disable_functions] = dir,chdir,opendir,readdir


<VirtualHost 19x.xxx.xxx.xx>
DocumentRoot /var/www/foo
ServerName foo.com

<IfModule mod_fastcgi.c>

    FastCgiExternalServer /foocgi/php5-wrapper -host

    ScriptAlias /foocgi/ /var/www/foo/cgi-bin/

    AddHandler php5-fastcgi .php
    Action php5-fastcgi /foocgi/php5-wrapper
    AddType application/x-httpd-php .php

    <Directory /var/www/foo/cgi-bin/>
         SetHandler fastcgi-script
        Options +ExecCGI


<Directory /var/www/foo>
allow from all
Options -Indexes SymLinksIfOwnerMatch


export PHPRC
exec /usr/lib/cgi-bin/php


<IfModule mod_fastcgi.c>
 FastCgiConfig -minProcesses 5 -maxProcesses 100

 <Directory "/var/www/cgi-bin/">
        AllowOverride none
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
share|improve this question
prorbaly you'll need to configure each php-pool with open_basedir line –  Andrei Mikhaltsov Jun 21 '13 at 9:19
i added the below ones to the pool configuration: php_admin_value[doc_root] = /var/www/foo php_admin_value[open_basedir] = /var/www/foo and no effect. Should i change the cgi.fix_pathinfo to 0 or 1 also? –  ogzy Jun 21 '13 at 12:31

Your Answer


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

Browse other questions tagged or ask your own question.