How to configure PHP FPM in NGINX CenotOS 7.5

By | August 23, 2018

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites

This part of this tutorial series we learn how to configure PHP-FPM 7,2 in NGINX server. Previous part of this tutorial we already install php-fpm .

Turn on PHP fpm for nginx

Sample outputs:

Start PHP fpm service

Stop PHP fpm service

Restart PHP fpm service

Get Status of PHP fpm service

Configure Nginx for using with PHP 7.2

Sample outputs:

Edit nano /etc/opt/remi/php72/php-fpm.d/www.conf:

set user and group to nginx 

how to configure php fpm in nginx cenotos 7.5 How to configure PHP FPM in NGINX CenotOS 7.5 3

Save and Close the file then restart php-fpm service

Update your nginx config file 

Edit as following line in server sections

Save and close file then check everything is working fine 

how to configure php fpm in nginx cenotos 7.5 How to configure PHP FPM in NGINX CenotOS 7.5 4

I write this file end of the server section . Now check nginx by following command 

Sample output if everything is working properly

Then restart nginx server 

Create a test script called test.php at /usr/share/nginx/html

Add this following line 

Save and close the file . Now open your browser and type your ip then test.php

how to configure php fpm in nginx cenotos 7.5 How to configure PHP FPM in NGINX CenotOS 7.5 5

if you see this page that means your php-fpm and nginx everything is working properly

Leave a Reply