?vscode如何远程开启xdebug

目的就是调试老项目,不想每次都dump,或者是log查看数据

先说下我操作是失败的,不知道那步出错了,想请大家看下,下面贴出我的操作步骤

步骤一: 远程主机 vscode 安装 phpxdebug 插件(可能会有点慢,慢的原因可能是接口接口回调有问题,卡了重启 vscode)

步骤二: php 安装 xdebug 拓展
vscode如何远程开启xdebug

步骤三: 安装 个人免费版 xshell
vscode如何远程开启xdebug

步骤四: 修改远程 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如何远程开启xdebug

vscode如何远程开启xdebug

vscode如何远程开启xdebug

vscode如何远程开启xdebug

隧道结果是成功的

vscode如何远程开启xdebug

配置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}",
            }            
        },
    ]
}

vscode如何远程开启xdebug

运行调试

vscode如何远程开启xdebug

vscode如何远程开启xdebug

vscode如何远程开启xdebug

结果是失败的

隧道没问题,配置也看不出问题,但是踩不到断点,是那里的配置错了吗?配置了一天了,各种配置方法都尝试过了,都无法踩中断点

reading
白小二
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!