您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息

部署xhprof监控php效率

2024/4/25 21:04:30发布7次查看
部署xhprof监控php效率1、安装xhprof扩展
下载地址:https://pecl.php.net/package/xhprof
2、配置php.ini
[xhprof]extension=xhprof.soxhprof.output_dir=/tmp
3、下载web界面程序并部署
下载地址:https://github.com/phacility/xhprof
将apache或者nginx解析地址解析到xhprof_html目录
4、在你需要监控的页面或者应用中添加代码
a/页头添加如下代码
if (extension_loaded('xhprof')) {xhprof_enable();}
b/页尾添加如下代码
if (extension_loaded(xhprof)) {$xhprof_name = test001;$xhprof_root = /vagrant_data/xhprof;include_once $xhprof_root . /xhprof_lib/utils/xhprof_lib.php;include_once $xhprof_root . /xhprof_lib/utils/xhprof_runs.php;$xhprof_data = xhprof_disable();$xhprof_runs = new xhprofruns_default();$run_id = $xhprof_runs->save_run($xhprof_data, $xhprof_name);echo ---------------\n.assuming you have set up the http based ui for \n.xhprof at some address, you can view run at \n.http://192.168.33.10:9998/index.php?run=$run_id&source=xhprof_foo\n.---------------\n;}
5、访问解析到xhprof的url
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录