Search code examples
phpfastcgiphp-5.2

multiple php.ini on fastcgi php5.2.17 on debian wheezy 64 bits and apache


some one can get me a clue about multi php.ini on fastcgi

I have compiled php5.2.17 php5.2.17======>>>http://museum.php.net/php5/php-5.2.17.tar.bz2

php52 patch ===>>>http://php52-backports.googlecode.com/files/php52-backports-security-20130717.patch Config:

./configure --prefix=/usr/share/php52 --datadir=/usr/share/php52   --mandir=/usr/share/man   --bindir=/usr/bin/php52   --with-libdir=lib64   --includedir=/usr/include   --sysconfdir=/etc/php52/apache2   --with-config-file-path=/etc/php52/cli   --with-config-file-scan-dir=/etc/php52/conf.d   --localstatedir=/var   --disable-debug   --with-regex=php   --disable-static   --disable-posix   --with-pear=/usr/share/php52  --enable-bcmath   --with-bz2   --enable-mbstring  --enable-sockets  --with-libxml-dir=/usr   --with-zlib    --enable-soap   --enable-zip   --with-mhash   --with-exec-dir=/usr/lib/php52/libexec   --without-mm   --with-curl=shared,/usr   --with-zlib-dir=/usr  --with-jpeg-dir=shared,/usr   --with-png-dir=shared,/usr    --with-pgsql=shared,/usr    --with-xsl=shared,/usr --with-tidy=shared,/usr  --enable-pdo=shared   --without-pdo-dblib   --with-pdo-pgsql=shared,/usr  --with-pdo-dblib=shared,/usr --with-libdir=/lib/x86_64-linux-gnu    --with-mcrypt  --without-pdo-sqlite --without-sqlite --disable-filter --with-pcre-regex --enable-fastcgi --sysconfdir=/etc/php52/apache2
make; make install

that work perfect Files after install:

/usr/lib/cgi-bin/php52-cgi

#!/bin/sh
PHPRC="/etc/php52/apache2/"
export PHPRC
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php52/php-cgi

i want to use a wrapper here to say something like use the php.ini from the current user ~/php.ini but.... not work for me...

other file is /etc/apache2/php52.conf

# Include file for virtual hosts that need to run PHP 5.2

<FilesMatch "\.php">
   SetHandler application/x-httpd-php5
</FilesMatch>

ScriptAlias /php52-cgi /usr/lib/cgi-bin/php52-cgi
Action application/x-httpd-php5 /php52-cgi

any help?


Solution

  • well i fix it... for each website on the apache2 config i did

    File: default on site-available

     <FilesMatch "\.php">
        SetHandler application/x-httpd-php5
     </FilesMatch>
    
     ScriptAlias /php52-cgi /home/{{user}}/php52-cgi
    
     Action application/x-httpd-php5 /php52-cgi
     AddHandler application/x-httpd-php5 .php
    

    so now i have a different CGI for each user

    File: php52-cgi

     #!/bin/sh
     PHPRC="/etc/php52/apache2/"
     export PHPRC
     PHP_FCGI_CHILDREN=4
     export PHP_FCGI_CHILDREN
     PHP_FCGI_MAX_REQUESTS=5000
     export PHP_FCGI_MAX_REQUESTS
     exec /usr/bin/php52/php-cgi  -c path/to/my/php/ini