Install PHP Performance test Tool xhprof for Windows + Apache + PHP 53

Source: Internet
Author: User
Tags php download
Original link: http://blog.snsgou.com/post-816.html

1. Download Xhprof

Here http://dev.freshsite.pl/php-extensions/xhprof.html download the Windows version of Xhprof, I choose here to download

Xhprof 0.10.3 for PHP 5.3 vc9 and xhprof_html

2, Installation Xhprof

Copy the Xhprof_0.10.3_php53_vc9.dll in the compressed package to the PHP ext directory, then add the configuration in the php.ini configuration (don't forget to create the corresponding folder)

[Xhprof]extension=xhprof_0.10.3_php53_vc9.dll; Directory used by default implementation of the Ixhprofruns; Interface (namely, the Xhprofruns_default Class) for storing; Xhprof runs.xhprof.output_dir= "D:/php/xhprof/log"

3. Using Xhprof

unzip the xhprof_html.zip to the root directory of the Web site you want to test, as I put it under the/public/xhprof/windows of the site directory.

Test file:

 
  0) {Bar ($x-1);}} function foo () {for ($idx = 0; $idx < 5; $idx + +) {bar ($IDX); $x = strlen ("abc");} Start xhprofxhprof_enable (xhprof_flags_cpu + xhprof_flags_memory);//Call the Foo function, which is also the function foo () we want to parse;//Stop Xhprof$xhprof_data = Xhprof_disable ();//Get Statistical data//print_r ($xhprof _data); $os = ' windows '; $XHPROF _root = DirName (__file__). '/public/xhprof/'. $os; include_once $XHPROF _root. "/xhprof_lib/utils/xhprof_lib.php"; include_once $XHPROF _root. "/xhprof_lib/utils/xhprof_runs.php";//save statistics, generate statistic ID and source name $xhprof_runs = new Xhprofruns_default (); $run _id = $ Xhprof_runs->save_run ($xhprof _data, "Xhprof_foo"); The source name is xhprof_foo//view statistics echo "Xhprof view";

When clicking on the link "[View full CallGraph]", an error will be added:

Failed to execute cmd: "Dot-tpng"

So you also need to download the graphical tools Graphviz.

4. Download Graphviz

Here http://www.graphviz.org/Download_windows.php download the Windows version of Graphviz, I choose here to download

Graphviz-2.38.zip

5, installation Graphviz

After extracting, copy the Graphviz to a directory, such as d:/php/xhprof/graphviz-2.38/

6, Configuration Graphviz

Locate the config.php file under the above mentioned site Directory/public/xhprof/windows/ , and adjust the following:

!--? php/** * Set the absolute paths on your system */define (' Error_file ', ' d:/php/ Xhprof/log/xhprof_dot_errfile.log ');d efine (' tmp_directory ', ' d:/php/xhprof/tmp ');d efine (' dot_binary ', ' d:/PHP/ Xhprof/graphviz-2.38/release/bin/dot.exe ');                                                 

Re-click the link [View full callgraph], a long awaited out:

Apache + PHP 53 Install PHP Performance test tool xhprof "/>

The above describes the installation of PHP Performance test tool xhprof for Windows + Apache + PHP 53, including the include side I want to be helpful to a friend who is interested in PHP tutorials.

  • 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.