Using ProxyPassMatch for FastCGI, results in connection refused on port 9000

Check if PHP-FPM is running. The error log says that apache can't make connection to 127.0.0.1:9000. Make it running and (maybe) the error will go.

Also check if PHP-FPM running via socket. Maybe it's running but not listening in TCP/IP stack.


Per Chris's comment, I just wanted to add if apache/php does support socket connections (looks like if apache > 2.4.10, it can support it), you can also change to use that in your apache config. I checked the php vi /etc/php/7.0/fpm/pool.d/www.conf file to see what socket listening to in the listen line:

listen = /run/php/php7.0-fpm.sock

Then added that to my /etc/apache2/sites-enabled/000-default.conf file (or whatever website you want to enable on)...

<FilesMatch \.php$>
    # 2.4.10+ can proxy to unix socket
    # SetHandler "proxy:unix:/var/run/php?-fpm.sock|fcgi://localhost/"

    # Else we can just use a tcp socket:
    # SetHandler "proxy:fcgi://127.0.0.1:9000"

    SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost/"
</FilesMatch>

Then restart the web server and then index.php shows up for me:

sudo service apache2 restart