Symfony 3:使用 Symfony 的开发服务器进行调试

Symfony 3: Debugging with Symfony's development server

在 Symfony 3.3 项目的开发过程中,我使用了 Symfony 的内部服务器 there 但是我不知道如何使用 xdebug 来调试它。我的意思是我已经通过以下方式安装和配置了 xdebug:

apt-get install php-xdebug

然后我导出:

export XDEBUG_CONFIG="idekey=phpstorm" 

但是当我在 IDE 上设置断点并通过 that 插件启用 xdebug 时,我仍然没有得到任何响应。

此外,我在 /etc/php/7.0/mods-available/xdebug.ini

上进行了以下设置
zend_extension=xdebug.so
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9021
xdebug.remote_mode=req

而且我已经将两个 PhpStorm 配置为侦听端口 9021。但是我仍然遇到无法让 PhpStorm 侦听断点的问题。

你们知道如何在我的 ubuntu-16.04 机器上解决这个问题吗?

此外,我已经查看了这些问题但没有成功:

编辑 1

我还尝试导出以下内容:

export XDEBUG_CONFIG="idekey=PHPSTORM"

正在配置 Firefox plugin but still get the very same behaviour. Also keep in mind that I made the PhpStorm to listen over xdebug by pressing the 按钮。

编辑 2

我还在我的 PhpStorm 上进行了以下配置:

还是不行。

最后需要进行以下步骤:

  1. 将以下内容填入:/etc/php/7.0/mods-available/xdebug.ini

    zend_extension=xdebug.so
    xdebug.remote_enable=On
    xdebug.remote_handler=dbgp
    xdebug.remote_host=localhost
    xdebug.remote_port=9021
    xdebug.remote_mode=req
    
  2. 导出:

    export XDEBUG_CONFIG="idekey=PHPSTORM"
    
  3. 然后按照 image 所示配置 PhpStorm。

  4. 设为IDE键PHPSTORM进入Firefox plugin

  5. 通过按 按钮在 Firefox 上启用 xdebug。或者,您可以将 url 附加到 ?XDEBUG_START 部分

  6. 然后在 PhpStorm 中按下 按钮。如果您看到 ,请再次按下它。

注意:

如果您更改 xdebug 设置 TERMINATE xdebug 会话,方法是按 按钮并再次按下。

此外,如果您 运行 通过终端作曲 禁用 PhpStorm 以通过按 按钮来侦听 xdebug。