Slackware HowTo

Configure PHP-FPM with Apache on Slackware

Separate the PHP engine from the web server using PHP-FPM and Apache with clean local testing.

1. Goal

Separate the PHP engine from the web server using PHP-FPM and Apache with clean local testing.

2. Files and components involved

/etc/rc.d/rc.php-fpm
/etc/php-fpm.d/www.conf
/etc/httpd/httpd.conf
/var/www/htdocs/info.php

3. Operational flow

enable rc.php-fpm
set listen to socket or port
load proxy_fcgi in Apache
create info.php

4. Operational verification

php-fpm -t
apachectl -t
/etc/rc.d/rc.php-fpm start
curl -I http://127.0.0.1/info.php

5. Practical notes

Test the configuration with a file separate from the real site and keep a copy of the previous config.

After changing the configuration, always run a syntax test and open the page from a browser or with curl on localhost.

Quick checklist

[ ] Backup or copy of the existing configuration completed
[ ] Files and commands updated as expected
[ ] Local test completed successfully
[ ] Logs or final output verified
[ ] Rollback procedure documented

Back to the Linux HowTo section