Failed to restart php-fpm.service: Unit php-fpm.service not found

Manoj Patidar picture Manoj Patidar · Dec 11, 2017 · Viewed 62.3k times · Source

My site showing error 502 Bad Gateway . on checking error log file i found error -
connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client

how can i fixed this issue ?

Answer

Jerodev picture Jerodev · Dec 11, 2017

Depending what version of php-fpm you are using, you need one of the following commands:

sudo service php5-fpm restart        // php 5.x
sudo service php7.0-fpm restart      // php 7.0.x
sudo service php7.1-fpm restart      // php 7.1.x