How to debug using Xdebug
sanderpost opened this issue · comments
Hi,
I ran into the following issue which I have resoved, but not in a satisfactory way.
I use Netbeans to start the debug client on port 9000. But since port 9000 is used by the docker-proxy process there's no way to have the xdebug to connect to my Netbeans debug client. How can I get xdebug to connect to my debugger client? It seems to me that IF you bind the host port 9000 to the container port 9000 there's no way to listen for the xdebug server "connect back".
I resolved the issue in the end by using net : "host" in the docker-compose file. This also requires me to drop the 'links' section which is pretty ugly imho.
Greetz,
Sander
It's been a long time since I've last used Xdebug so I'm afraid I don't have anything to add. I do remember it working smoothly when used with PhpStorm.
same question,is anybody success?
what's your config in PhpStorm and php.ini
I don't have them anymore I'm afraid.
Don't use 9000 port.
xdebug.ini
example config:
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
xdebug.remote_enable=on
xdebug.remote_port=9001
xdebug.remote_host=192.168.199.100
xdebug.remote_connect_back=0
xdebug.remote_handler=dbgp
xdebug.remote_log=/var/log/php-fpm/xdebug-remote.log
xdebug.remote_host
don't set 127.0.0.1
http://jamescowie.me/blog/2016/12/all-hail-xdebug-and-lets-let-var-dump-die/
Cheers!