Configure installation Xhprof steps in Window Wamp

Source: Internet
Author: User
Tags ini require vc9 zip

1. Download here http://dev.freshsite.pl/php-extensions/xhprof.html if you do not download it, you can send 16090288@qq.com email, explain the version.

I use the Wamp 2.2d 32-bit, here wordy, since the use of Windows Wamp, do not install 64-bit, after all, is the development environment, the formal environment must be 32-bit

Download two files Xhprof 0.10.3 for PHP 5.3 vc9.zip Xhprof_html.zip

2. Installation. This step is very simple, the xhprof 0.10.3 for PHP 5.3 vc9.zip DLL file renamed to Php_xhprof.dll placed in the PHP ext directory, and then in the PHP.ini configuration to add configuration (do not forget to create the corresponding folder)

The code is as follows Copy Code

[Xhprof]
Extension=php_xhprof.dll
; Directory used by default implementation of the Ixhprofruns
; Interface (namely, the Xhprofruns_default Class) for storing
; Xhprof runs.
Xhprof.output_dir= "D:/wamp/logs/xhprof_log"

Restart your wamp to see if there are any files in phpinfo ()

3. Use:

Xhprof_html.zip this file into the root directory of the site you want to test.

Now the site is generally used is the framework, the only entry point is the best, directly in the index.php inside write is good, I use the YAF frame

The code is as follows Copy Code

<?php
Xhprof_enable ()/Start
Require ' init.php ';
Require ' conf/db.inc.php ';
$app = new Yaf_application (Base_path. "/conf/itxiangqin.ini");
Yaf_registry::set (' config ', Yaf_application::app ()->getconfig ());
$app->bootstrap ()->run ();
$xhprof _data = xhprof_disable ();//end, then write file, note directory
$XHPROF _root = Realpath (dirname (__file__). /xhprof ');
Include_once $XHPROF _root. "/xhprof_lib/utils/xhprof_lib.php";
Include_once $XHPROF _root. "/xhprof_lib/utils/xhprof_runs.php";

Save raw data for this profiler run using default
Implementation of Ixhprofruns.
$xhprof _runs = new Xhprofruns_default ();

Save the run under a namespace "Xhprof_foo"
$run _id = $xhprof _runs->save_run ($xhprof _data, "Xhprof_foo");
echo "<a href= ' http://www.pztai.com/xhprof/xhprof_html/?run= $run _id&source=xhprof_foo ' > Analysis </a>"; /

Here Pztai to your own domain name is good, local localhost analysis </a> ";//here Pztai to your own domain name is good, local localhost
Still learning to use, write a few abbreviations

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.