This module for apache 2.4 allows you to use e.g. mod_proxy_fcgi in AddHandler or SetHandler directives.
apxs -i -a -c mod_proxy_handler.c
Send php files to php-fpm running on a TCP socket:
# set handler for php
LoadModule proxy_handler_module modules/mod_proxy_handler.so
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9000/"
</FilesMatch>
# configuration for phpmyadmin package in archlinux
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
DirectoryIndex index.html index.php
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>
It is slow because it opens a new connection to php-fpm on every request, instead of reusing an existing pool like ProxyPass(Match) does.
This can be workarounded by setting up a dummy worker for the same proxy url as explained here:
http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#workers
An example configuration could be:
It is important that the URLs to the proxy match, in order for them to use the same worker.
Also, i just noticed that support for this was merged into Apache 2.4.10. So if you are running at least that version, you don't need this module anymore. See http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#handler