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_fromin 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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -