On my Prosper202 – Nginx tutorial, I use Unix Socket because it’s faster. But unix socket has some issues with high-loads. So if you’re experiencing 502 or 504 errors, switching to TCP/IP will solve it. So let’s do it.
Open PHP-FPM pool config file:
nano /etc/php5/fpm/pool.d/www.conf
Search for following line and uncomment it,
listen.backlog = 65536
Now search for following line,
listen = /var/run/php5-fpm.sock
And replace it with,
listen = 127.0.0.1:9000
Changes to php-fpm are now done. But there are some changes you should do to Nginx virtual host configurations. Open virtual host file for your domain with following command,
nano /etc/nginx/sites-available/example.com
Look for following line,
fastcgi_pass unix:/var/run/php5-fpm.sock;
And replace it with,
fastcgi_pass 127.0.0.1:9000;
Now restart php-fpm,
service php5-fpm restart
Then Nginx’
service nginx restart
And that’s it. You should edit all your virtual host files and make the above change.
Awesome man! you saved my life. Thank you so much for this help!
Thank. You. This was driving me (and my client) nuts.
thanks man. Its it works.