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>
This script helped me a lot, thanks progandy! I just have one problem, if I type a url with a non-existent php file it still goes through the proxy instead of ignoring it and it doesn't use the standard 404 error document from apache. Anyone had the same problem?
OS: RedHat 6
PHP: 5.5.18
Apache: 2.4.6