Nginx + php-fpm: Bad gateway only when xdebug server is running -
problem
when xdebug server running intellij idea, 502 bad gateway
nginx when try loading site trigger breakpoints.
if stop xdebug server, site works intended.
so, i'm not able run debugger, did work (!). not able pinpoint why stopped working.
setup
a short explanation of setup (let me know if need expand on this).
my php app running in docker container, , linked nginx running in different container using volumes_from
in docker compose config.
after starting app, can verify using phpinfo();
xdebug module loaded.
my xdebug.ini has following content:
zend_extension=xdebug.so xdebug.remote_enable=1 xdebug.remote_host=10.0.2.2 xdebug.remote_connect_back=0 xdebug.remote_port=5555 xdebug.idekey=complex xdebug.remote_handler=dbgp xdebug.remote_log=/var/log/xdebug.log xdebug.remote_autostart=1
i got ip address remote_host (where xdebug server running) these steps:
docker-machine ssh default route -n | awk '/ug[ \t]/{print $2}' <-- returns 10.0.2.2
to verify reach debugging server within php container, did following steps
docker exec -it randomhash bash nc -z -v 10.0.2.2 5555
giving following output depending on xdebug server running or not:
- running:
connection 10.0.2.2 5555 port [tcp/*] succeeded!
- not running:
nc: connect 10.0.2.2 port 5555 (tcp) failed: connection refused
so intellij idea surely set receive connections on 5555. did appropriate path mapping between source file paths , remote path (when setting php remote debugging server within idea).
any ideas? kind of lost on 1 don't have experience of these technologies :d
Comments
Post a Comment