Netbeans PHP:详细的 运行 PUT 请求配置 JSON body - XDEBUG 的使用需要如此详细的配置

Netbeans PHP: detailed run configuration for PUT request with JSON body - use of XDEBUG requires such detailed configuration

我正在尝试使用 Netbeans/PHP/XDEBUG 调试 API PUT 请求和 JSON 正文。当我(从 Netbeans)执行 'Debug - Debug project' 时,Netbeans 使用 'Project - Properties - Run Configuration' 中的 URL 打开 Firefox Web 浏览器。 运行 配置仅适用于 GET 请求,我可以提供查询字符串参数,但是 JSON 主体没有字段,也没有应该发出 PUT 请求的选项。因此,虽然我想接收带有自定义 JSON 正文的 PUT 请求,但 Netbeans 只发出没有正文的 GET 请求。因此,这实际上使得 PUT 请求无法使用来自 Netbeans 的 XDEBUG。

或者 - 如何为 PUT/JSON 主体创建 运行 配置以及如何在启动项目调试时使用此 运行 配置有什么技巧吗?

我正在使用 Netbeans 11.0,如有必要,我很乐意升级。但是我不确定在最新版本的 Netbeans 中是否有更多关于我的情况的选项。

我不知道 Netbeans,但您可以使用 Xdebug 的 xdebug.start_with_request=yes,它会为每个网络服务器请求启动到 IDE 的调试连接。

为此,您需要将 IDE (Netbeans) 置于侦听模式, 中解释了如何做到这一点:

go to project properties > run configuration > advanced > debug url and check do not open web browser. Do not set the host under debugger proxy. Save these settings. In the project window, on your project: right mouse click > debug (this starts listening for debug connections).

然后在浏览器、curl 或任何其他方式中提出您的请求。