PHP-FPM under Ubuntu 19.10
The FastCGIServer used by Apache in earlier versions is no longer available, so we need a slightly different approach. Fortunately the replacement is an Apache internal module, so a lot of the shenanigans we went through to connect Apache & the external CGI server is now unnecessary
So firstly there is the basic installation of what we need:
apt-get install php7.2-fpm
a2enconf php7.2-fpm
a2enmod proxy_fcgi
a2enmod proxy
This is installing and activating the PHP FPM module, but assumes the other modules a supplied with the default Apache setup, it’s just that they need to be activated.
There are two lines only to add to the host configuration files, so continuing to use my example website equipel.co.uk
ProxyPassMatch “^/(..php(/.)?)$” “unix:/run/php/php7.2-fpm.equipel.co.uk.sock|fcgi://localhost/var/www/britishaplassociation.org” enablereuse=on
and with the Directory directive add
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.2-fpm.cvsshows.co.uk.sock|fcgi://localhost/"
</FilesMatch>
That’s it. Because this is an internal module we don’t have to do all of the linkages we did before. Remember to restart Apache
service apache2 restart
The FPM pool settings are the same as before