【问题标题】:Using VSCode with PHP (7) Debugger in Ubuntu在 Ubuntu 中使用 VSCode 和 PHP (7) 调试器
【发布时间】:2019-11-01 14:00:04
【问题描述】:

我在 Ubuntu 中使用 VSCode 来处理一个 php 项目。我使用 php 调试器扩展(和 xdebug)工作得很好,但现在它突然停止工作。 (没有更新,没有改变配置。只是一个简单的重启计算机)。确切的问题是 VSCode 不会在代码中的断点处停止。

Netbeans 与 xdebug 配合得很好,所以我不知道是什么导致 VSCode 出现这个问题。

我应该尝试任何提示或想法?

提前致谢。

我已经更改了运行 xdebug 的端口,从 Internet 尝试不同的 launch.json,但不知道发生了什么。我最近激活了日志选项,并且我有一些来自 vscode 的输出,关于“格式错误的 HTTP 请求”,我想这是一个线索。

这是我设置的配置的launch.json 文件。 (xdebug 在 php.ini 文件中的 9090 端口)

{
    // 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": 9090,
            "log": true
        },
        {
            "name": "Launch server",
            "type": "php",
            "request": "launch",
            "program": "${workspaceRoot}/site/index.php",
            "runtimeExecutable": "php",
            "runtimeArgs": [
                "-dzend_extension=/usr/lib/php/20170718/xdebug.so",
                "-S",
                "0.0.0.0:9090"
            ],
            "cwd": "${workspaceRoot}",
            "port": 9090,
            "log" : true
        }
    ]
  }

VSCode 日志的输出:

<- launchResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 2,
  command: 'launch',
  success: true }

<- outputEvent
OutputEvent {
  seq: 0,
  type: 'event',
  event: 'output',
  body:
   { category: 'stderr',
     output:
      '[Fri Nov  1 10:50:06 2019] 127.0.0.1:49922 Invalid request (Malformed HTTP request)\n' } }

【问题讨论】:

    标签: php visual-studio-code vscode-debugger


    【解决方案1】:

    这很尴尬,但我用 CTROL + F5 执行 iDE,而不是 F5(我习惯于 Visual Studio)。

    这就是整个问题...

    谢谢!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-05
      • 2020-06-08
      • 2021-03-15
      • 2020-03-29
      • 1970-01-01
      • 2020-09-18
      • 2019-05-06
      • 1970-01-01
      相关资源
      最近更新 更多