Xdebug 3 - 设置“xdebug.remote_***”已重命名,请参阅升级指南

nas*_*971 9 php xdebug phpstorm

我刚刚在我的 OSX 上安装了 Xdebug v3.0.0beta1 并尝试在 PhpStorm 2020.1 上使用它,但我得到了这个:

Xdebug: [Config] 设置 'xdebug.remote_enable' 已重命名,请参阅https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_enable 上的升级指南 (请参阅:https : //xdebug.org/docs /errors#CFG-C-CHANGED ) Xdebug: [Config] 设置 'xdebug.remote_host' 已重命名,请参阅https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_host 上的升级指南 (请参阅: https://xdebug.org/docs/errors#CFG-C-CHANGED ) Xdebug: [Config] 设置“xdebug.remote_mode”已重命名,请参阅https://xdebug.org/docs/upgrade_guide 上的升级指南#changed-xdebug.remote_mode (参见:https : //xdebug.org/docs/errors#CFG-C-CHANGED) Xdebug: [Config] 设置 'xdebug.remote_port' 已重命名,请参阅https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_port 上的升级指南

提供的链接只会导致带有错误的图像。

我的问题是要设置的正确设置是什么以及在哪里实际更改它们,因为我的 php.ini 文件中没有关于 xdebug 的任何内容。

Ale*_*not 16

PhpStorm 2020.3 支持 XDebug3。有关于如何正确更改设置的详细升级指南

就我而言(使用 Docker),我不得不更改设置

从:

; v2.*

[Xdebug]
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=off
xdebug.remote_host=host.docker.internal
Run Code Online (Sandbox Code Playgroud)

到:

; v3.*

[Xdebug]
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal
Run Code Online (Sandbox Code Playgroud)

  • 谢谢,你的 v3 示例帮助我注意到现在的值不同了。 (2认同)
  • xdebug.start_with_request=yes 是我必须做的。谢谢 (2认同)

小智 7

我的 php -v

PHP 7.2.34-8+ubuntu20.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 16:57:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.34-8+ubuntu20.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v3.0.1, Copyright (c) 2002-2020, by Derick Rethans
Run Code Online (Sandbox Code Playgroud)

我通过以下步骤让 Xdebug v3 与 PHPStorm 2020.2.3 一起使用:

  1. export XDEBUG_SESSION=PHPSTORM

  2. 更新 php.init 文件

    xdebug.extension=/usr/lib/php/20200930/xdebug.so <== path to your xdebug.so file
    #xdebug.remote_autostart=1
    xdebug.start_with_request=yes
    #xdebug.remote_connect_back=1
    xdebug.discover_client_host=true
    xdebug.remote_cookie_expire_time = 3600
    #xdebug.remote_enable = 1
    #xdebug.remote_host = localhost
    xdebug.client_host=localhost
    #xdebug.remote_port = 9000
    xdebug.client_port = 9000
    xdebug.remote_handler = dbgp
    xdebug.idekey=PHPSTORM
    xdebug.mode = debug
    
    Run Code Online (Sandbox Code Playgroud)

    '#' 是旧版本 (Xdebug 2.x)

  3. 重置apache2:sudo service apache2 restart


Laz*_*One 6

Xdebug 3 仅从 PhpStorm 2020.3版本开始支持,目前处于 EAP 阶段(Early Access Program),将在大约 1 个月的时间内发布。

目前,您必须为 2020.1 IDE 版本坚持使用 Xdebug 2.9 或尝试最新的 2020.3 EAP 版本:https ://www.jetbrains.com/phpstorm/nextversion/

最新的EAP #6版本支持 Xdebug 3 :https : //blog.jetbrains.com/phpstorm/2020/11/phpstorm-2020-3-eap-6/


至于在更改 Xdebug 设置 (php.ini) 方面的 Xdebug 3 升级 - 请查看此链接:https : //3.xdebug.org/docs/upgrade_guide

Xdebug 3 相关文档目前托管在临时https://3.xdebug.org/域上。


如果您愿意,您可以将 2020.1 PhpStorm 与 Xdebug 3 一起使用——只需正确配置 Xdebug 3。

在 Windows 10 上使用 Xdebug 3.0.0beta1、PHP 7.4 x64 对我来说效果很好——请参阅这个问题:https ://stackoverflow.com/a/64820427/783119

您看到的那些错误表明您的 php.ini 中仍然有 Xdebug 2 配置值。