时间:2021-07-01 10:21:17 帮助过:3人阅读
wget http://pecl.php.com/get/xhprof-0.9.2.tgztar zxf xhprof-0.9.2.tgzcd xhprof-0.9.2cp -r xhprof_html xhprof_libcd extensionphpize./configuremakemake install
[xhprof]extension=xhprof.so;; directory used by default implementation of the iXHProfRuns; interface (namely, the XHProfRuns_Default class) for storing; XHProf runs.; 记得WEB要有写入权限xhprof.output_dir=
wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.26.3.tar.gz tar zxf graphviz-2.26.3.tar.gz cd graphviz-2.26.3 ./configuremake make install
//author http://www.lai18.comxhprof_enable();//打开xhprof/******程序逻辑 Start******/function test1(){ sleep(3); return;}function test2(){ test1();}function test3(){ test2();}function p(){ echo 'xhprof test
';}p();test3();/******程序逻辑 End******/$xhprof_data = xhprof_disable();//关闭xhprof//保存xhprof数据include_once '../xhprof_lib/utils/xhprof_lib.php';include_once '../xhprof_lib/utils/xhprof_runs.php';$xhprof_runs = new XHProfRuns_Default();$xhprof_source = 'xhprof_test';$run_id = $xhprof_runs->save_run($xhprof_data, $xhprof_source);$report_url = 'http://xhprof.rebill.info/index.php?run='.$run_id.'&source='.$xhprof_source;echo '
';echo 'view the performance report:'.$report_url.'';