简体   繁体   中英

XDebug: Windows + Docker + PHPStorm

My OS is Windows 10. I've run Docker via the boot2docker image. IDE I use is PHPStorm. What I want to do is debug with XDebug, but I don't get it running. I searched the Web and tried the examples I found but nothing helps. Is there anyone with the same architecture who can help me?

Edit: Nginx ist running on the server.

Current setup: xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.idekey=PhpStorm

PhpStorm server Host is same IP I connect for SSH. Path mappings is enabled. Debugger is Xdebug I tried already with a specific DBPg Proxy but no success

I got it. I just forgot to forward the port. I've to run the container via docker run -d -p 80:80 -p 9000:9000 -v /mnt/www/foo:/var/www/foo foo .

I used the following setting in ini file:

xdebug.remote_connect_back=0
xdebug.remote_host=host.docker.internal

php.ini

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
; Set to host.docker.internal on Mac and Windows, otherwise, set to host real ip
xdebug.remote_host = host.docker.internal
xdebug.remote_port = 9000
xdebug.remote_log = /var/log/php/xdebug.log

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM