Sam Nazarko

Setting up with PHP7 (FPM) on Apache 2 the right way

When deploying a LAMP setup, I still prefer to use apache2 over nginx.

Recently, I was updating a LAMP stack to Debian Stretch and wanted to review some notes. I noticed that there is now a lot of outdated documentation with regards to configuring PHP fpm with apache2. A lot of literature still suggests that mod_fastcgi should be used, but this is not correct.

This should be all you need to do:

apt-get install apache2 php-fpm
a2enconf php7.0-fpm
a2enmod proxy proxy_fcgi
service apache2 reload

There is no need to set a configuration via /etc/apache2/conf*. It’s all handled automatically.

Posted March 3, 2018

Written by Sam Nazarko, a 20s London chap who is an open source developer by night. Follow me on Twitter