Install PHP FPM on CentOS 6/7

11

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.

Share this page:

See also how to:

A very simple steps to install PHP 7 on CentOS 7
How to run your PHP or Bash script as root in the most secure way
How to install PostgreSQL database server on Linux
How to install Java runtime environment on CentOS 7
How to install MySQL database server on CentOS 7