All Projects → swoole → Debugger

swoole / Debugger

Licence: apache-2.0
Swoole 远程调试器

为 Swoole Server 设计的远程终端

基于swoole-1.8的多协议特性实现,业务无需做任何修改,只需要加一行代码即可引入一个功能强大的远程终端。

安装

composer require swoole/debugger

注册 Shell 到 Swoole Server 对象

  • 建议只监听本机127.0.0.1或局域网192.168.1.100
\Swoole\Debugger\RemoteShell::listen($serv, '127.0.0.1', 9599);

连接到远程终端

[email protected]:~/workspace/proj/remote-shell/tests$ telnet 127.0.0.1 9599
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
p|print [variant]	打印一个PHP变量的值
e|exec [code]	执行一段PHP代码
w|worker [id]	切换Worker进程
l|list	打印服务器所有连接的fd
s|stats	打印服务器状态
c|coros	打印协程列表
cs|costats	打印协程状态
el|elapsed [cid]	打印某个协程运行的时间
tl|timer_list	打印当前进程中所有定时器ID
ti|timer_info [timer_id]	打印某个定时器信息
ts|timer_stats	打印当前进程中的定时器状态
b|bt	打印协程调用栈
i|info [fd]	显示某个连接的信息
h|help	显示帮助界面
q|quit	退出终端
#2>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].