HostOnNet Blog

Enable php-fpm in CentOS 7

Looking for Linux Server Admin or WordPress Expert? We can help.

To install php-fpm on CentOS, run

yum -y install php-fpm

Now you need to edit Apache configuration to activate php-fpm

Edit file /etc/httpd/conf.d/php.conf

vi /etc/httpd/conf.d/php.conf

Find

SetHandler application/x-httpd-php

Replace with

SetHandler "proxy:fcgi://127.0.0.1:9000"

Enable php-fpm start on boot

systemctl enable php-fpm
systemctl start php-fpm

Restart Apache

systemctl restart httpd

Now if you check phpinfo(), you will see Server API changed to FPM/FastCGI.

Posted in CentOS

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.