4
I am having a 502 error that represents some configuration on the server, when I try to open a site using linux, Nginx and php7. Researching some other POSTS, link about the same error I see that php needs fpm to be recognized in Nginx. However fpm is installed and updated. See photo below:
According to the error 505 something’s going on on the server. It shouldn’t be php-7 (I think). Does anyone have any idea what it might be?
Updating
And finally it seems that it is an error due to PHP. I tested with an html file and I had no problems. So it seems that there is something with php itself. What can it be?
Latest logs
2016/07/06 06:14:56 [crit] 834#834: *15 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: ig.app, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "ig.app"
2016/07/06 06:15:04 [crit] 834#834: *15 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: ig.app, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "ig.app"
2016/07/06 06:15:04 [crit] 834#834: *15 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: ig.app, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "ig.app"
2016/07/06 06:16:29 [crit] 834#834: *15 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: ig.app, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "ig.app"
You can paste the Nginx log?
– user3603
Yeah, it looks like he’s looking for a php5-fpm file and isn’t finding it. But I’m using it with php-7 that already has fpm. Any idea?
– zwitterion
In the configuration file
/etc/nginx/sites-available/default
you update fromfastcgi_pass unix:/var/run/php5-fpm.sock;
forfastcgi_pass unix:/var/run/php7-fpm.sock;
– user3603
that’s right. You almost got it right. instead of changing in the folder
default
I changed in the project folder, in caseig.app.conf
. A note: in the installation of linux php7 16.04 LTS through theapt install php-dev
orapt install php
(that in linux 16.04 will install php7.0 as default), note that after the folder/var/run/
there is still one more directory/php
. I mean, the whole way is/var/run/php/php7-fpm.sock
and not/var/run/php7-fpm.sock
. Put your answer to receive the credits.– zwitterion
Very good! : ) Put this as an answer because someone looking for this problem on the main page will see that no answer and may not even click
– user3603