How to solve this error "connect() to unix:/var/run/php5-fpm.sock failed"

i get this error continuously "connect() to unix:/var/run/php5-fpm.sock failed ". i tried many possibility but this is not solved. Please help in urgently to solve this.


Hi guys… I was getting same error on my server and the server was shutting down many many times along the day…

I solved this upgrading the PHP version. PHP 5x to PHP 7.0.

Server configuring: Ubuntu 14.04 Nginx PHP 5x -> to PHP 7.0

I followed this tutorial:

Wish this help you too!

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @DhavalPadshala

That means PHP-FPM is not running. Start it by running sudo service php5-fpm restart

Thank you @hansen For help me .

And sorry for my bad english @hansen

Thank’s help. i make change as you say. i tried Php 7 but it is not perfect for my script. Currenly i am using droplet of this configuration 16gb/8 cpu , 40 gb ssd, 6tb.

@hansen I am running an image creating script using php gd. and error only occurred when high traffic.

My Php pool Configuration file ==>

Thnx again @hansen My PHP configuration competed same as you suggest. and actually error will not occurred continuously on website… it will some time in website . when there was an high traffic on server.

and i am running Ubuntu 14.04

Thnx for reply @hansen i do this many time but it is not work. please tell me there is another way to solve this problem .