简介
aaron-dev/xhprof-webman是一款适配webman的代码性能分析插件。
主要对旧版且无法使用的xhprof做优化调整,用于适配webman,安装简单快捷。
开发者可以通过浏览器快速访问性能分析报告,排查代码性能问题。
作者博客
安装
php要安装xhprof扩展
在php.ini中增加配置1
2
3
4[xhprof]
extension=xhprof.so;
xhprof.output_dir=/tmp/xhprof;
Use Composer:1
composer require aaron-dev/xhprof-webman
配置
- config增加全局中间件
1 | '' => [ |
- 创建控制器,复制下面代码
1 | <?php |
- 路由增加以下代码(页面入口 + 静态资源,静态资源从包内直接提供,无需复制到 public)
1 | Route::get('/test', ['app\controller\TestController','index']); |
- 基础配置在 config/plugin/aaron-dev/xhprof/xhprof.php 中
1 | 'enable' => true, |
- 然后重启服务就可以访问了。


本插件参考phacility/xhprof、phpxxb/xhprof
本文作者:
艾瑞可erik
本文链接: https://erik.xyz/open/xhprof-webman.html
版权声明: 本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。转载请注明出处!
本文链接: https://erik.xyz/open/xhprof-webman.html
版权声明: 本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。转载请注明出处!