Step _ PHP Tutorial

Source: Internet
Author: User
Tags vc9
Configure and install xhprof in Ingress wwamp. This article introduces how to configure and install xhprof in mongowwamp. I hope some methods will be helpful to you. 1. download dev. freshsit here. this article will introduce you to the xhprof configuration and installation methods and specific steps in window wamp. I hope some methods will be helpful to you.

1. Download here http://dev.freshsite.pl/php-extensions/xhprof.html if you cannot download it down, you can send an email to The 16090288@qq.com to describe the version.

I am using wamp 2.2d 32-bit. here, I am sorry, since windows wamp is used, I should not install 64-bit. after all, it is a development environment, the formal environment must be 32-bit

Download two XHProf 0.10.3 for PHP 5.3 vc9.zip xhprof_html.zip files.

2. install. This step is very simple. rename the dll file in XHProf 0.10.3 for PHP 5.3 vc9.zip to php_xhprof.dll and put it in the ext directory of php. add configuration in ini configuration (do not forget to create the corresponding folder)

The code is as follows:

[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 is any corresponding file in phpinfo ().

3. use:

Unzip the xhprof_html.zip file to the root directory of the website you want to test.

Currently, websites generally use Frameworks. the only entry point is the best. you can write them directly in index. php. I use the yaf framework.

The code is as follows:

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, and then write the file. pay attention to the 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 "analysis ";//

You can replace pztai here with your own domain name, and analyze localhost locally "; // you can replace pztai here with your own domain name. localhost
I am still learning to use it.

Configure and install xhprof methods and specific steps in javaswamp. I hope some methods will be helpful to you. 1. download http://dev.freshsit here...

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.