First, install the extension
Download xhprof extension: http://dev.freshsite.pl/php-extensions/xhprof.html
Put the extension file: Extract the. dll file after downloading and copy it to the Ext folder in PHP.
Open extension: Add the following code to the php.ini
[Xhprof]extension=Xhprof.dllxhprof.output_dir="f:/xhprof/xhprof_log"
Second, install the PHP analysis package
This extension requires a PHP program to invoke.
Baidu Network disk Download: Http://pan.baidu.com/s/1pJtck7D
Official website Download: pecl.php.net/package/xhprof
Unzip to f:/xhprof/xhprof-0.9.4 after download
There's a basic example in file F:\xhprof\xhprof-0.9.4\examples\sample.php.
//Start Profilingxhprof_enable ();//Here's the code you want to analyze./Stop Profiler$xhprof _data=xhprof_disable ();include_once"F:/xhprof/xhprof-0.9.4/xhprof_lib/utils/xhprof_lib.php";include_once"F:/xhprof/xhprof-0.9.4/xhprof_lib/utils/xhprof_runs.php";//Save raw data for this profiler run using default//implementation of Ixhprofruns.$xhprof _runs=NewXhprofruns_default ();//Save the run under a namespace "Xhprof_foo"$run _id=$xhprof _runs->save_run ($xhprof _data, "Xhprof_yii");//Export the performance log to the folder you specified when you installed the extension
Then access the code you need to analyze to get a log file. F:\xhprof\xhprof_log\55fd13b01475f.xhprof_yii.xhprof
Third, view the generated log
Configure a domain name, root directory to F:\xhprof\xhprof-0.9.4\xhprof_html.
Access the domain name to view the log file you just generated.
Resources Download:
Xhprof
Http://pecl.php.net/package/xhprof
Http://mirror.facebook.net/facebook/xhprof/doc.html
Https://github.com/facebook/xhprof
Installing PHP Profiling Tools under Windows Xhprof