am getting a 502 bad getway nginx/1.10.3 (Ubuntu) on my php application on digital ocean droplet

November 15, 2018 1k views
PHP Debian

I had my php application working fine, i think one day it upgraded itself and now my web application has an error. i have searched online for a possible solution. i have checked my error logs it says “connect() to unix:/var/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, ”. i cant seem to locate the php7.0-fpm.sock but their is file. please help me. i have tried almost everything. i am new in the development world. any help will be appreciated. thank you in advance

1 Answer


It looks like that your PHP-FPM sock file is either missing or incorectly specified in your Nginx config. What I would suggest here is following the instructions here in Step 3 on how to configure PHP-FPM and Nginx:

Hope that this helps!

by Justin Ellingwood
by Mark Drake
This tutorial details the process for installing and configuring the components that constitute a LEMP stack on an Ubuntu 18.04 server, including Nginx, MySQL, and PHP. It also includes instructions for testing that these components can communicate effectively and serve your content correctly.
Have another answer? Share your knowledge.

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