I have two sites that I run from apache 2.2 vhosts with PHP-FPM 5.4 on Ubuntu 12.04. Until now I've been using a server-wide (stock) mod_fastcgi config, but now I want to split this into two FPM pools so that I can use different PHP settings for each (e.g. one is a dev site so has error display enabled).
I've set up two FPM pools with different names and socket locations, as per the docs, disabled the global fastcgi config, copied it into my vhosts and altered it to point at the different pools for each vhost, like this:
<IfModule mod_fastcgi.c> <FilesMatch \.php$> SetHandler php-script </FilesMatch> Action php-script /php5.fcgi virtual Alias /php5.fcgi /var/fastcgi/php5.fcgi FastCGIExternalServer /var/fastcgi/php5.fcgi -socket /var/run/php5-fpm-www.sock <Directory "/var/fastcgi"> Order allow,deny <Files "php5.fcgi"> Order deny,allow Deny from all Allow from env=REDIRECT_STATUS </Files> </Directory> </IfModule>
There are actually 4 vhosts as there are regular and SSL flavours of each hostname, and each pair points at one FPM pool.
The problem I run into is that apache throws an error saying:
FastCgiExternalServer: redefinition of previously defined class "/var/fastcgi/php5.fcgi"
How should this be done?