Php VS代码调试器-Felix Becker-调试器不';我什么也打不到

Php VS代码调试器-Felix Becker-调试器不';我什么也打不到,php,visual-studio-code,xdebug,Php,Visual Studio Code,Xdebug,我最近安装了Felix Becker的php调试器。 无论我做什么配置设置,我的调试器都不会命中任何东西。 下面是我的conf文件 xdebug.ini [xdebug] ; debug xdebug.default_enable = $value xdebug.remote_autostart = $value xdebug.remote_connect_back = 0 xdebug.remote_host = $value xdebug.remote_port = $value xdebu

我最近安装了Felix Becker的php调试器。 无论我做什么配置设置,我的调试器都不会命中任何东西。 下面是我的conf文件

xdebug.ini

[xdebug]
; debug
xdebug.default_enable = $value
xdebug.remote_autostart = $value
xdebug.remote_connect_back = 0
xdebug.remote_host = $value
xdebug.remote_port = $value
xdebug.remote_enable = 1
xdebug.idekey = $value

; profiling
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = /tmp

zend_extension=xdebug.so
Launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9009,
            "pathMappings": {
                "path/path": "$value"
            }
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
  
            "port": 9009,
            "pathMappings": {
                "path/path": "$value"
            }
        }
    ]
  }

我在这里遗漏了什么吗?

在v1.52.1中推出了对Becker扩展的修复,请参阅


Felix Becker的php调试器扩展使用了以前不推荐使用的api,因此上一个vscode版本1.52意味着它不会遇到断点。vscode的github在这方面存在许多问题。vscode团队成员建议启用此设置以修复:

Debug:允许断点无处不在

另一个选项是使用另一个扩展,该扩展已更新其代码以适应不推荐。有关示例,请参见


Xdebug v3.0.1,由Derick Rethans编写

您正在使用Xdebug v3,但请继续使用Xdebug v2配置参数。您需要检查并调整设置(主要是更改参数名称)

Xdebug v3使用的配置参数与Xdebug v2不同。从我看到的9个“xdebug”中有8个。当前php.ini中的参数在xdebug v3中不执行任何操作

对于Xdebug 3,它应该是这样的(基于原始配置):

zend_extension=xdebug.so
[xdebug]
xdebug.mode=debug
; 对于分析,请切换到以下位置:
;xdebug.mode=profile
xdebug.client\u host=${PHP\u xdebug\u REMOTE\u host}
xdebug.client_port=${PHP_xdebug_REMOTE_port}
xdebug.discover\u client\u host=false
xdebug.start\u with\u request=${PHP\u xdebug\u REMOTE\u AUTOSTART}
xdebug.idekey=${PHP\u xdebug\u IDE\u KEY}
xdebug.output_dir=/tmp
注意:出现故障时,发现客户端主机将返回到客户端主机(不同于仅尝试自动检测主机的v2)


p.p.S.
xdebug.default_enable=1
xdebug.mode=develop
替换。如果需要,则可以通过逗号列出多个值,例如
xdebug.mode=develope,debug

谢谢您的回答。我尝试了天星的新插件。还是一样。不走运。你也试过这个设置吗?是的,马克。两样东西都试过了。它没有命中任何断点。对此表示抱歉。我将把答案留在这里,因为这给可能会发现这个问题的人带来了很多悲伤。你的PHP和Xdebug版本是什么?Php7.3.11 PHP debug由Felix Becker v1.13.0Thanks编写,但我问的是Xdebug版本(在PHP端进行调试的实际PHP扩展),而不是VSCode扩展。我这样问是因为Xdebug v3使用了与v2不同的配置参数——也许这里也是这样。Xdebug v3.0.1,由Derick Rethans编写“Xdebug v3.0.1,由Derick Rethans编写”在这种情况下,请检查并更新您的Xdebug配置。您使用的是Xdebug v2配置参数,v3使用的是不同的配置参数。在v3中,您当前的设置几乎都不起任何作用。