VS Code 调试器 - Felix Becker - 调试器没有遇到任何问题 [英] VS Code Debugger - Felix Becker - Debugger doesn't hit anything

查看:32
本文介绍了VS Code 调试器 - Felix Becker - 调试器没有遇到任何问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了 Felix Becker 的 php 调试器.无论我做什么配置设置,我的调试器都没有遇到任何问题.以下是我的 conf 文件.

I have recently installed php debugger by Felix Becker. No matter whatever config settings I do, my debugger is not hitting anything. Following are my conf files.

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"
            }
        }
    ]
  }

我在这里遗漏了什么吗?

Am I missing anything here ?

推荐答案

Xdebug v3.0.1,Derick Rethans 编写

Xdebug v3.0.1, by Derick Rethans

您正在使用 Xdebug v3,但继续使用 Xdebug v2 配置参数.您需要通过 从 Xdebug 2 升级到 3 指南 并调整您的设置(主要只是更改参数姓名).

You are using Xdebug v3 but keep using Xdebug v2 config parameters. You need to go through Upgrading from Xdebug 2 to 3 Guide and adjust your settings (mostly just change the parameter name).

Xdebug v3 使用与 Xdebug v2 不同 的配置参数.从我看到的 9 个xdebug"中有 8 个.您当前 php.ini 中的参数在 Xdebug v3 中什么都不做.

Xdebug v3 uses different config params than Xdebug v2. From what I see 8 out of 9 "xdebug." params from your current php.ini do nothing in Xdebug v3.

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

For Xdebug 3 it should be something like this (based on your original config):

zend_extension=xdebug.so

[xdebug]
xdebug.mode = debug
; for profiling switch to below:
;xdebug.mode = profile

xdebug.client_host = ${PHP_XDEBUG_REMOTE_HOST}
xdebug.client_port = ${PHP_XDEBUG_REMOTE_PORT}
xdebug.discover_client_host = false
xdebug.start_with_request = ${PHP_XDEBUG_REMOTE_AUTOSTART}
xdebug.idekey = ${PHP_XDEBUG_IDE_KEY}
xdebug.output_dir = /tmp

附言xdebug.discover_client_host 现在会在失败时回退到 xdebug.client_host(不像 v2 只会尝试自动检测的主机).

P.S. xdebug.discover_client_host will now fallback to xdebug.client_host on failure (unlike v2 that would try autodetected host only).

P.P.S.xdebug.default_enable = 1 替换为 xdebug.mode = develop.如果您需要,那么您可以通过逗号列出多个值,例如xdebug.mode = 开发,调试

P.P.S. xdebug.default_enable = 1 is replaced by xdebug.mode = develop. If you need that then you can list multiple values via comma, e.g. xdebug.mode = develop,debug

这篇关于VS Code 调试器 - Felix Becker - 调试器没有遇到任何问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆