Xdebug 不与主管一起工作作为后台运行程序

Xdebug not working with supervisor as background runner

我目前有一个我不太明白的问题。 情况是这样的:

我 运行 PHP7.2 在 Mac.

上的 Vagrant 和 Parallels 下基于 Debian 的盒子中

Xdebug 配置:

zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.default_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_host = 192.168.24.1
xdebug.remote_port = 9000
xdebug.idekey=PHPSTORM
xdebug.remote_log="/home/vagrant/base/log/xdebug.log"

调用 Symfony CLI 应用程序工作正常。 但是,一旦我通过主管调用它,Xdebug 就不会做出应有的响应。 我尝试了几件事但都失败了。

在 PhpStorm 中我收到这条消息:

Cannot find file '/VMPATH/console' locally.
To fix it, set server name by environment variable PHP_ID_CONFIG and restart debug session

但我在网上找不到任何关于如何解决此问题的帮助。 感谢您的帮助!

尝试添加行

environment=PHP_IDE_CONFIG="serverName=PHPSTORM"

到您的主管配置块。示例:

[program:my_worker]
directory={{API_PATH}}
command={{API_PATH}}/my_worker.php "verificationWorker.php"
environment=PHP_IDE_CONFIG="serverName=vagrant"
user=www-data
autostart=false
autorestart=true

详情here

并确保通过 php 安装了 xDebug 扩展来执行后台脚本。