Xdebug:IDE 最小化几分钟后,脚本会在后台自动恢复 运行

Xdebug: Script resume running automatically in the background after the IDE is minimized for a few minutes

我在 Docker 2.3.0.3 (45519) 上使用 PhpStorm 2020.1.4 和 Xdebug 2.6.1 在 Mac 上 OSX 10.15.6

调试已经停止,但脚本还在运行。我知道,因为我可以看到数据库中发生了变化。

我希望我可以回到 PhpStorm 并且调试器仍然挂在与我将浏览器(或任何其他程序)放在前面之前相同的断点。

有人知道如何存档吗?

这是我的 Xdebug 配置:

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"

xdebug.remote_host=host.docker.internal
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
xdebug.remote_connect_back=0

xdebug.profiler_enable_trigger=1
xdebug.profiler_enable=0
xdebug.profiler_output_dir=/var/www/vhosts/my-site/logs/profiler
xdebug.profiler_output_name=%R

所以它是一个 Mac 和一个 Docker 容器。

这似乎是由于 Docker 丢弃了空闲的 TCP 连接。修改 ~/Library/Group Containers/group.com.docker/settings.json 并更改 vpnKitPortMaxIdleTime 的值应该可以解决问题。设置为 0 似乎表示无限。

补充阅读:

P.S.原解来自this PhpStorm Forums thread.