?vscode如何远程开启xdebug
目的就是调试老项目,不想每次都dump,或者是log查看数据
先说下我操作是失败的,不知道那步出错了,想请大家看下,下面贴出我的操作步骤
步骤一: 远程主机 vscode 安装 phpxdebug 插件(可能会有点慢,慢的原因可能是接口接口回调有问题,卡了重启 vscode)
步骤二: php 安装 xdebug 拓展
步骤三: 安装 个人免费版 xshell
步骤四: 修改远程 php.ini
[Xdebug]
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=On
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.remote_host = "localhost"
xdebug.remote_port=9090
xdebug.remote_handler="dbgp"
xdebug.profiler_append = 0
xdebug.remote_enable=On
步骤五:重启 Php,我这里用宝塔
步骤六:开启宝塔9090端口,开启云服务器9090端口
步骤六:使用 xshell 建立隧道
隧道结果是成功的
配置vscode launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "liveIm",
"type": "php",
"request": "launch",
"port": 9091,
// 远程目录->本地目录 目录映射
"pathMappings": {
"/www/wwwroot/mhxmpc.mhuan.shop": "${workspaceRoot}",
}
},
]
}
运行调试
结果是失败的
隧道没问题,配置也看不出问题,但是踩不到断点,是那里的配置错了吗?配置了一天了,各种配置方法都尝试过了,都无法踩中断点