title: PHP-FPM is not working as expected
body: <p>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.</p>
  
  <p>disable_functions at the conf file is not working as well. I haven't figured it out the reason.</p>
  
  <p>Sample files are below:</p>
  
  <p>/etc/php5/fpm/pool.d/foo.conf:</p>
  
  <pre><code>[foo]
  
  user = foo
  group = foo
  
  listen = 127.0.0.1:9018
  listen.allowed_clients = 127.0.0.1
  
  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
  php_admin_value[doc_root] = /var/www/foo
  php_admin_value[open_basedir] = /var/www/foo
  
  access.log = /var/log/$pool.access.log
  access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
  </code></pre>
  
  <p>/etc/apache2/sites-enables/foo.com:</p>
  
  <pre><code>&lt;VirtualHost 19x.xxx.xxx.xx&gt;
  DocumentRoot /var/www/foo
  ServerName foo.com
  
  &lt;IfModule mod_fastcgi.c&gt;
  
       FastCgiExternalServer /foocgi/php5-wrapper -host 127.0.0.1:9018 -user foouser -group foogroup
  
  
      ScriptAlias /foocgi/ /var/www/foo/cgi-bin/
  
      AddHandler php5-fastcgi .php
      Action php5-fastcgi /foocgi/php5-wrapper
      AddType application/x-httpd-php .php
  
      &lt;Directory /var/www/foo/cgi-bin/&gt;
           SetHandler fastcgi-script
          Options +ExecCGI
      &lt;/Directory&gt;
  
  &lt;/IfModule&gt;
  
  &lt;Directory /var/www/foo&gt;
  allow from all
  Options -Indexes SymLinksIfOwnerMatch
  &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>/var/www/foo/cgi-bin/php5-wrapper:</p>
  
  <pre><code>#!/bin/sh
  PHPRC=/etc/php5/cgi/
  export PHPRC
  #export PHP_FCGI_MAX_REQUESTS=5000
  #export PHP_FCGI_CHILDREN=8
  exec /usr/lib/cgi-bin/php
  </code></pre>
  
  <p>/etc/apache2/mods-enabled/fastcgi.conf:</p>
  
  <pre><code>&lt;IfModule mod_fastcgi.c&gt;
   FastCgiConfig -autoUpdate -singleThreshold 100 -killInterval 300 -idle-timeout 240 -maxClassProcesses 1 -pass-header HTTP_AUTHORIZATION
   FastCgiWrapper /usr/lib/apache2/suexec
  
   &lt;Directory "/var/www/cgi-bin/"&gt;
          AllowOverride none
          Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
          Order allow,deny
          Allow from all
    &lt;/Directory&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>/var/log/foo.access.log is empty though port 9018 is LISTEN at netstat output. The site is being opened without errors also. Any idea about the chroot problem or how to make the disable_functions work?</p>