dbgpProxy php 远程xdebug调试

远程xdebug调试

xdebug调试开发环境,测试环境等非本地环境代码
需要把dbgp Proxy启动在可以被开发环境或测试环境链接通的机器,我就直接在测试环境启动dbgpProxy服务。

dbgpProxy, php-fpm, 编辑器三者通信示意图

在这里插入图片描述

dbgpProxy下载:

https://xdebug.org/download#dbgpProxy

在这里插入图片描述

dbgpProxy-启动

-i 指定IDE注册端口
-s 指定php-fpm链接端口

./dbgpProxy-macos -h
Xdebug DBGp proxy (0.3)
Copyright 2020 by Derick Rethans
11:16:11.472 [warn] [SSL] The 'certs/fullchain.pem' file could not be found, not enabling SSL listeners
Usage: dbgpProxy-macos [-hv] [-i host:port] [-s host:port] [parameters ...]
 -h    Show this help
 -i, --client=host:port
       Specify the host:port to listen on for IDE (client)
       connections [localhost:9001]
 -s, --server=host:port
       Specify the host:port to listen on for debugger engine
       (server) connections [localhost:9000]
 -v    Show version number and exit
启动
./dbgpProxy-macos -i :9001 -s 127.0.0.1:9022

phpStorm注册dbgpProxy

设置bdgpProxy IP 端口和 ide key

tools -> DBGp Proxy -> Configuration
ip: 上一步启动dbgpProxy的机器IP
port: 上一步 -i 参数指定的端口号
IDE key: 个人名称,区别与他人, 每人维一。
在这里插入图片描述

注册DBGp Proxy

tools -> DBGp Proxy -> Register IDE
看右下角提示,成功。
在这里插入图片描述

在这里插入图片描述

phpStorm 启动xdebug监听

Run -> Start Listening For PHP Debug Connections
在这里插入图片描述

url 增加XDEBUG_SESSION_START=ide key

如:

http://codeper.cn/index-api/v1/test?XDEBUG_SESSION_START=owen

总结

php.ini 配置原程IP和port为 dbgpProxy监听的端口
phpStorm 要注册到dbgpProxy
phpStorm 启动监听PHP debug
url 增加XDEBUG_SESSION_START 参数

下载地址

https://xdebug.org/download#dbgpProxy

https://code.activestate.com/komodo/remotedebugging/

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值