wget http://pecl.php.net/get/xhprof-0.9.2.tgztar zxf xhprof-0.9.2.tgzcd xhprof-0.9.2cp -r xhprof_html xhprof_lib <directory_for_htdocs>cd 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.; 记得<directory_for_storing_xhprof_runs>WEB要有写入权限xhprof.output_dir=<directory_for_storing_xhprof_runs>
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 '<h3>xhprof test</h3>';}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 '<br>';echo 'view the performance report:<a href="'.$report_url.'" target="_blank">'.$report_url.'</a>';PHP编程
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。
新闻热点
疑难解答