Configure Xdebug and Wincachegrind on the Wamp

Source: Internet
Author: User
Tags php performance tuning

Read an article on the internet that Xdebug+wincachegrind is a good tool for PHP performance tuning. So to download this, install the use of a look. :)

The following is my installation configuration

1 Download Xdebug http://www.xdebug.org

Download wincachegrind:http://sourceforge.net/projects/wincachegrind/

2 xdebug Copy to PHP extension file directory: d:/wamp/bin/php/php5.2.5/ext/

Edit PHP.ini to add the following configuration line:

Zend_extension_ts= "D:/wamp/bin/php/php5.2.5/ext/xdebug.dll"

;;;;;;;;;;;;;;;;;;;

; Xdebug Settings;

;;;;;;;;;;;;;;;;;;;

Xdebug.auto_trace=on

Xdebug.collect_params=on

Xdebug.collect_return=on

Xdebug.trace_output_dir= "D:/wamp/bin/php/debuginfo"

Xdebug.profiler_enable=on

Xdebug.profiler_output_dir= "D:/wamp/bin/php/debuginfo"

Then restart Apache.

Configuration Instructions

Zend_extension_ts= "D:/wamp/bin/php/php5.2.5/ext/xdebug.dll"

Load the Xdebug module. This cannot be loaded in a extension=php_xdebug.dll way, and must be loaded in a zend way. The installation document says.

Xdebug.auto_trace=on;

Automatically opens the function module of "Monitoring function call procedure". This feature can output the monitoring information of function calls as files in the directory you specify. The default value for this configuration entry is off.

Xdebug.collect_params=on;

Opens the feature that collects function parameters. The parameter values of the function call are included in the monitoring information of the Function procedure call. The default value for this configuration entry is off.

Xdebug.collect_return=on

Opens the feature that collects function return values. The return value of the function is included in the monitoring information of the Function procedure call. The default value for this configuration entry is off.

Xdebug.trace_output_dir= "D:/wamp/bin/php/debuginfo"

Sets the path of the output file for the function call monitoring information.

Xdebug.profiler_enable=on

Open the Performance Monitor.

Xdebug.profiler_output_dir= "D:/wamp/bin/php/debuginfo"

Set the path of the output file of the performance monitoring information.

3 Install Wincachegrind, this is needless to say:).

4 Open IE Access http://localhost:8080/demo/index.php

Then open the directory: d:/wamp/bin/php/debuginfo/can see automatically generated files Cachegrind.out.xxxx and TRACE.2732500414.XT

With Wincachegrind you can see that the function,mothed are invoked during index.php execution, defining those variables, loading those files, and the time it takes to perform those operations.

Oh, so you can start looking for those who spend the most of the time the operation!

Put a picture below:

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.