ByteInternet / hypernode-docker

Fast and easy Docker for Magento development
https://community.hypernode.io/hypernode-docker
35 stars 9 forks source link

502 Bad Gateway #12

Closed Aquive closed 1 year ago

Aquive commented 6 years ago

Trying to use a docker box which I made earlier. It says 502 Bad Gateway when I try to reach PHP files. I tested a plain PHP file with hello world. Same problem. Plain html or txt files are serving as expected.

I checked logs, it gives below error in /var/log/nginx/error.log

2018/07/24 13:08:01 [error] 1074#1074: *11 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /fpm_status HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"

I tried restarting services with below command. But the same problem and errors occur. How can I fix this?

bash /etc/my_init.d/60_restart_services.sh

vdloo commented 6 years ago

Hi @Aquive, what does pdstatus say? It should output this if all services are running:

$ pdstatus
everything ok

I suspect there's something wrong with the php-fpm daemon. What is your setup? Are you on Linux? Any alterations to the Dockerfile? If you log in as root (and the php-fpm isn't already running) and you run this what do you see?

root@8be474b3865b ~ # /usr/sbin/php-fpm7.1 --nodaemonize --fpm-config /etc/php/7.1/fpm/php-fpm.conf
Aquive commented 6 years ago

Thanks @vdloo just fixed the issue with your suggestions.

It was configured to use php 5.5, it did work for a while. But now it doesn't. I switched it to use 5.6 and now its working.