Installing PHP Profiling Tools under Windows Xhprof

Source: Internet
Author: User
Tags php profiling tools

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.