How To Switch PHP-FPM Listen On Unix Socket


Here is how you can switch PHP-FPM to listen on a unix socket rather than a TCP socket. This guide assumes you have already installed a LEMP stack as shown in Install LEMP on Centos.

Switch PHP-FPM Listen On Unix Socket

Step 1. First, edit the file at /etc/php-fpm.d/www.conf and find this block:

Step 2. Next, let’s create a file at /etc/nginx/conf.d/ named php5-fpm.conf:

Step 3. Open Nginx virtual-host config file(s), In our Nginx server config we’ll also have to change where to pass PHP requests:

Step 4. Reload php-fpm and nginx.

Nginx Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “Nginx Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!