无法使用 Symfony CLI / Xdebug 进行调试

问题描述 投票:0回答:3

我正在使用

symfony server:start
命令运行我的服务器,我想像往常一样使用 PhpStorm 提供的 PHP 远程调试来调试它。

我已经用这些配置了我的 Xdebug:

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9001
xdebug.idekey = PHPSTORM
zend_extension=xdebug.so
xdebug.remote_autostart = 1

我已经为我的浏览器安装了调试工具,并在 PHP 远程调试窗口中配置了我的服务器。

当我尝试调试我的 IDE 时,它在

/myuser/.symfony/php/3769648aac6303b385b2ccc41cfd442044060c7d-router.php:12
处中断了路由器,并说它在项目之外。

我也尝试过路径映射,但没有结果。

如果您需要更多信息,请告诉我。

php phpstorm xdebug symfony5
3个回答
2
投票

我正在使用 PHP 7.4 CLI 运行,我尝试安装最新版本的 PHP-FPM,它现在使用与上面相同的配置。

我还禁用了选项

the Settings/Preferences | Languages & Frameworks | PHP | Debug | Xdebug | Force break at first line when a script is outside the project
,正如@LazyOne所说,谢谢他。


0
投票

我仍然有这个问题。每个调试请求最终都会弹出 intellij 并显示对路由器文件的传入请求批准

/home/user/.symfony/php/xxxx-router.php
,并且在
[ Accept ]
之后什么也没有发生,并且实际的断点被忽略。

Force break at first line when a script is outside the project
”设置已禁用。

它是 php 8.1,带有 xdebug 3.1.5,

symfony server:start

还将 symfony 服务器路径添加到跳过的路径中并没有真正的帮助。

Xdebug 设置:

还可以检查什么?


0
投票

另一个重要通知 - 您需要禁用“忽略外部连接”,否则 PhpStorm 将忽略调试连接

© www.soinside.com 2019 - 2024. All rights reserved.