CentOS 7 Apache use PHP-FPM

Install PHP-FPM with command

yum install php-fpm

Edit www.conf

vi /etc/php-fpm.d/www.conf


listen =

Replace with

listen = /var/run/php-fpm/default.sock


;listen.owner = nobody
;listen.group = nobody

Replace with

listen.owner = apache
listen.group = apache

Edit php.conf

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


    	ProxySet disablereuse=off

	SetHandler proxy:fcgi://php-fpm

AddType text/html .php

DirectoryIndex index.php

	SetHandler application/x-httpd-php-source

Restart Apache/php-fpm

systemctl restart httpd
systemctl restart php-fpm

Method 2

Here is php-fpm config using proxy_fcgi


Need help with Linux Server or WordPress? We can help!

Leave a Reply

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