Installation of Xdebug

Source: Internet
Author: User
Tags php debugger zend

Xdebug is an open source PHP debugger that is loaded and used as a PHP module.

Under Windows platform:

First, install Xdebug module

1, to www.xdebug.org download the corresponding version of PHP module files, save the downloaded file to the PHP ext directory, you can modify the name of the file, now the latest version is 2.0.1.

2, modify php.ini, add the following information

[Xdebug]
zend_extension_ts="c:/webserver/php5/ext/php_xdebug.dll"
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.trace_output_dir="c:/webserver/php5/debuginfo"
xdebug.profiler_enable=on
xdebug.profiler_output_dir="c:/webserver/php5/debuginfo"

Parameter explanation:

Zend_extension_ts= "C:/webserver/php5/ext/php_xdebug.dll"

Load the Xdebug module. This can not be loaded in a extension=xdebug-xxx.dll way, must be loaded in a ZEND way, otherwise installed, phpinfo print out of the Xdebug segment will have xdebug not LOADED as ZEND Warning message for extension.

Xdebug.auto_trace=on

Automatically opens the "Monitoring function call process" of the work mode. 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= "C:\Temp\xdebug"

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= "C:\Temp\xdebug"

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

In addition, Xdebug cannot work with Zend Optimizer and other Zend extensions (DBG, APC, APD etc) at the same time, and the problem is now being repaired.

There are some more specific parameter settings, see: http://www.xdebug.org/docs-settings.php

3, restart Apache

In this way, when you run PHP locally, you will generate some debugging information files in the directory you set up:

* Function call process monitoring information file filename format: trace.xxxxxx.xt. This file can be viewed directly, which contains information such as the time the function was run, the parameter value of the function call, the return value, the file and location in which it was located. The content format is still relatively intuitive.

* The file name format of the effectiveness monitoring document: Cachegrind.out.xxxxxxxx.

This file can also be viewed directly, but the information format is not easily understood by humans,

So we need the next software.

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.