gpt4 book ai didi

php - 未与 PhpStorm 建立连接 Xdebug 3

转载 作者:行者123 更新时间:2023-12-05 00:55:17 26 4
gpt4 key购买 nike

下午好。

当尝试在 PHP 8 上调试脚本时,PhpStorm 报告与版本 3 xdebug 没有连接。适用于 3 以下的所有版本。我尝试将 xdebug.remote_{host, port} 的参数更改为 xdebug.client_{host, port} 但也没有帮助。

最佳答案

Xdebug 3 将仅在 PhpStorm 2020.3 版本中得到全面支持,该版本目前处于 EAP 阶段(Early Access Program),将在大约 1 个月后发布。

最新的 EAP #6 版本已经支持它:查看这篇博文了解更多信息:https://blog.jetbrains.com/phpstorm/2020/11/phpstorm-2020-3-eap-6/


我已经在 Windows 10 上为我的 PHP 7.4 下载了 Xdebug 3.0.0beta1,从头开始配置它(使用正确的 Xdebug 3 配置值:https://3.xdebug.org/docs/upgrade_guidehttps://3.xdebug.org/docs/all_settings)... 它仍然可以正常工作PhpStorm 2020.2.3.

是的,IDE 在启动 CLI 脚本调试时会发送旧式参数(如 xdebug.remote_{host, port} 等),但调试仍然可以正常工作。

这是我的 Xdebug 3 设置的 php.ini 内容(就这么简单):

[xdebug]
xdebug.client_host = 127.0.0.1
xdebug.client_port = 9001
xdebug.mode = debug

(我有更多设置,但这些是针对输出文件名、日志位置、在某些情况下/需要时快速打开某些选项等的额外内容的自定义——这里不需要这些,它没有它们也能正常工作)
enter image description here

从 IDE 启动的 CLI 调试(“PHP 脚本”类型的配置):
enter image description here

这就是 IDE 正在执行的内容:E:\Projects\php\php74\php.exe -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9001 -dxdebug.remote_host=127.0.0.1 E:\Projects\web\_idetest\test.php。正如您所见,这些旧式参数根本不会影响 Xdebug 3。

附:如果我在 php.ini 中设置 xdebug.start_with_request = yes ,那么即使在 Run (或在 IDE 之外执行 PHP 脚本时)也可以进行调试——只要“电话 handle ”图标为绿色( IDE 监听传入的调试请求)。

关于php - 未与 PhpStorm 建立连接 Xdebug 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64819310/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com