所以,我试图让vscode-firefox-debug发挥作用。
它vscode-firefox-debug
声称与 兼容vscode remote
。
我如何配置这个东西,与我的遥控器一起工作?
我所有的开发都是在远程无头服务器上完成的,运行 Slackware64 14.2
让我们称之为 box 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
我用 Firefox 运行 "C:\Program Files\Mozilla Firefox\firefox.exe" -start-debugger-server
我已经Remote-SSH
和朋友们设置好了,并且可以很好地使用vscode-php-debug和XDebug
.
添加到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}"
},
我在调试控制台中收到一条通知,说:
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}"
},
按照链接帮助您:
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
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句