php - 交响乐 3 : Debugging with Symfony's development server

标签 php symfony ubuntu-16.04 xdebug symfony-3.3

在 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但仍然会得到完全相同的行为。还要记住,我通过按 phpstop xdebug button 让 PhpStorm 监听 xdebug。按钮。

编辑 2

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

Php configuration

还是不行。

最佳答案

最后需要进行以下步骤:

  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. 然后将 PhpStorm 配置为 image显示。

  4. PHPSTORM 设置为 IDE key Firefox plugin

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

  6. 然后按button disabled xdebug PhpStorm 中的按钮。如果您看到 PhpStorm enable xdebug](/image/whuPx.png) button press that until it becomes ![button disabled xdebug然后再按回去。

注意:

如果您通过按 PhpStorm enable xdebug 更改 xdebug 设置终止 xdebug session 按钮,然后再次按下。

此外,如果您通过终端运行 composer 禁用 PhpStorm 以通过按 PhpStorm enable xdebug 来监听 xdebug按钮。

关于php - 交响乐 3 : Debugging with Symfony's development server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46947621/

相关文章:

elasticsearch - Ubuntu 16.10:作为守护程序运行Elasticsearch或仅在系统启动时启动它

php - 如何按月和按日提取 MySQL 数据以填充表格以使用 PHP libchart 绘制图形?

php - 开发 API - 如何使其安全?

javascript - 如何在 javascript 中将背景图片正确设置为弹出窗口?

rest - 给定查询中没有组件字段 [field](500 内部服务器错误)

php - 我如何在 symfony2 中使用 DQL 获得单个结果

symfony - symfony 2.8 在预热期间是否按正确的顺序加载 bundle 和服务?

python - 无法删除Python3.5

Java 相当于 PHP str_word_count?

c++ - gdb 错误不是可执行格式 : File format not recognized