XDebug: Windows + Docker + PHPStorm

XDebug: Windows + Docker + PHPStorm

我的 OS 是 Windows 10。我已经 运行 Docker 通过 boot2docker 图像。 IDE 我用的是PHPStorm。我想做的是使用 XDebug 进行调试,但我不明白 运行ning。我在网上搜索并尝试了我找到的例子,但没有任何帮助。有相同架构的人可以帮助我吗?

编辑:Nginx ist 运行在服务器上。

当前设置: 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 服务器 主机与我为 SSH 连接的 IP 相同。路径映射已启用。调试器是 Xdebug 我已经尝试使用特定的 DBPg 代理,但没有成功

我明白了。我只是忘了转发端口。我必须通过 docker run -d -p 80:80 -p 9000:9000 -v /mnt/www/foo:/var/www/foo foo 到 运行 容器。

我在 ini 文件中使用了以下设置:

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