【问题标题】:VSCode + Remote - SSH + VS Code Debugger for Firefox, How?VSCode + Remote - 用于 Firefox 的 SSH + VS Code 调试器,如何?
【发布时间】:2019-09-20 09:48:18
【问题描述】:

所以,我正在尝试让vscode-firefox-debug 播放。

它,vscode-firefox-debug,声称与vscode remote 兼容。

如何配置这个东西,以使用我的遥控器?

我所有的开发都是在远程无头服务器上完成的,运行 Slackware64 14.2

让我们称那个盒子为www.example.com

我的本​​地邮箱是Windows 8.1 x64 Pro,带有:

Firefox 69.0.1 (64-bit)

Visual Studio Code
Version: 1.38.1 (system setup)
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:35:15.005Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 6.3.9600

我用"C:\Program Files\Mozilla Firefox\firefox.exe" -start-debugger-server运行firefox

我已经完成了Remote-SSH 和朋友的设置,并且可以很好地与vscode-php-debugXDebug 配合使用。

添加到远程服务器上的launch.json。我尝试了一些变体:

第一次尝试

    {
      "name": "Launch localhost",
      "type": "firefox",
      "request": "launch",
      "reAttach": true,
      "url": "http://localhost/index.html",
      "webRoot": "${workspaceFolder}"
    },

第二次尝试

    {
      "name": "Attach localhost",
      "type": "firefox",
      "request": "attach",
      "url": "http://localhost/index.html",
      "webRoot": "${workspaceFolder}"
    },

第三次尝试

    {
      "name": "Launch index.html",
      "type": "firefox",
      "request": "launch",
      "reAttach": true,
      "port": 6000,
      "file": "${workspaceFolder}/index.html",
      "url": "https://www.example.com/index.html",
      "webRoot": "${workspaceFolder}"
    },

我在调试控制台中收到 Notification,说:

Firefox can't open a file in a remote workspace

最后一次尝试

    {
      "name": "Attach index.html",
      "type": "firefox",
      "request": "attach",
      "port": 6000,
      "url": "https://www.example.com/",
      "webRoot": "${workspaceFolder}"
    },

【问题讨论】:

    标签: firefox visual-studio-code remote-debugging vscode-debugger vscode-remote


    【解决方案1】:

    点击链接帮助您:

    https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug

    在服务器上运行以手动启动 xdebug 的示例,同时通过 SSH 进行调试,本地 VS 代码 IDE 上的文件为:

    $ php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 -dxdebug.remote_connect_back=1 /var/www/html/teste.php
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-30
      • 2022-10-15
      • 2018-08-16
      • 2020-02-24
      • 2022-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多