Symfony 4 Xdebug 不支持 REST API

Symfony 4 Xdebug not working with REST API

我的 Xdebug 有问题,就像所有安装正确一样,我设置了一个断点,但没有任何反应,即尽管有断点,调试器也没有停止。

我的/etc/php/7.4/apache2/conf.d/20-xdebug.ini配置

zend_extension=/usr/lib/php/20190902/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.show_error_trace = 1
xdebug.remote_autostart = 0o

当我执行 php -v 时,我得到:

PHP 7.4.6 (cli) (built: May 14 2020 10:03:28) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies
    with Xdebug v2.9.5, Copyright (c) 2002-2020, by Derick Rethans

我的 PhpStorm 设置:

我在 PhpStorm 中设置了断点:

我正在编写 REST API 起诉 Symfony 4 并使用 Postman 发送请求并想调试代码。

有什么想法吗?如何调试我的 REST API?

无论是否运行,XDEBUg 都不依赖于 PHP 框架。

我看到一个“0o”。将它设置为 1。虽然 apache 不应该以“0o”开头。

xdebug.remote_autostart = 0o

这是我的 XDEBUG 配置,但是在 docker.

xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=0
xdebug.remote_port=9000
# xdebug.remote_host=${IP} # docker

您还有:

xdebug.idekey = PHPSTORM

尝试使用 ?XDEBUG_SESSION_START=PHPSTORM

调用端点

运行 处设置复选标记 -> 在 PHP 脚本 的第一行处打断。这样你就可以看到 XDEBUG 是否有反应。

然后请在以下位置配置您的应用程序:运行 -> 编辑配置 -> 模板 -> PHP 远程调试