Apache2 FCGID – Using PHP FPM with Apache2 FCGID

apache-2.2php-fpm

Apache2 has a built in fastcgi replacement, called fcgid. That's fine, but it lacks the FastCgiExternalServer directive, which I used to connect to the PHP-FPM. How can I do the same with the fcgid module in apache2?

My goal is to use php-fpm with apache2 (on debian squeeze).

Best Answer

It is not possible to use an externally spawned FastCGI-aware process like the ones created by php-fpm with mod_fcgid. It simply lacks this feature.

If you don't want to use mod_fastcgi, i.e. because you think it's too big or insecure or old, you might want to look at an alternative like mod_proxy_fcgi.

You might also be delighted to hear that Apache httpd 2.4 (and the current developer release in the 2.3 series) already comes with a mod_proxy implementation for FastCGI, incidentally also called mod_proxy_fcgi.