在 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 机器上解决这个问题吗?
此外,我已经研究了这些问题但没有成功:
- Xdebug configuration with PHP fastcgi and eclipse?
- Is it possible to use Xdebug with the built in PHP test server?
编辑 1
我还尝试导出以下内容:
export XDEBUG_CONFIG="idekey=PHPSTORM"
配置Firefox plugin但仍然会得到完全相同的行为。还要记住,我通过按 让 PhpStorm 监听 xdebug。按钮。
编辑 2
我还在我的 PhpStorm 上进行了以下配置:
还是不行。
最佳答案
最后需要进行以下步骤:
将以下内容放入:
/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
导出:
export XDEBUG_CONFIG="idekey=PHPSTORM"
然后将 PhpStorm 配置为 image显示。
将
PHPSTORM
设置为 IDE key Firefox plugin通过按 在 Firefox 上启用 xdebug按钮。或者,您可以将 url 附加到
?XDEBUG_START
部分然后按 PhpStorm 中的按钮。如果您看到 然后再按回去。
注意:
如果您通过按 更改 xdebug 设置终止 xdebug session 按钮,然后再次按下。
此外,如果您通过终端运行 composer 禁用 PhpStorm 以通过按 来监听 xdebug按钮。
关于php - 交响乐 3 : Debugging with Symfony's development server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46947621/