sokil /php-debug-utils

调试工具

dev-master 2019-11-12 21:20 UTC

This package is auto-updated.

Last update: 2024-09-13 08:15:33 UTC


README

远程调试

当代码在远程服务器上执行,而PHP运行时需要连接到本地机器上的IDE,但远程服务器不能直接连接到本地IDE时,可能很有用。

首先将远程端口转发到本地端口,由IDE可访问

ssh -fN some-ssh-host -R 9000:127.0.0.1:9000

然后运行脚本

./debugRemote /path/to/some.php arg1 arg2

构建火焰图

有关火焰图的更多信息,请参阅 http://www.brendangregg.com/flamegraphs.html

运行脚本并传递目标路径到SVG文件

./flameGraph /path/to/flamegrapg.svf /path/to/some.php arg1 arg2

火焰图将存储在 /path/to/flamegrapg.svf