# Install PHP FPM on CentOS 6/7

73

Install the service:

yum install php-fpm

PHP FPM config file is now located at /etc/php-fpm.d/www.conf

There are many settings there, but I'd recommend to set a couple parameters right away. First — OS user and group of FPM service. Set the same user and group as your web-server has. For example, if you're going to use FPM with NGINX web-server then set:

user = nginx
group = nginx

Second — if you're going to use FPM and web-server on the same machine (which is almost always the case) then set listen parameter to Unix domain socket instead of TCP socket:

;listen = 127.0.0.1:9000
listen = /var/run/php-fpm.sock

Unix domain sockets are faster than TCP sockets and in some cases are more secure.

Rate this post: