HostOnNet Blog

Enable php-fpm in CentOS 7

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