Xdebug Debug Environment Configuration

Source: Internet
Author: User
Tags configuration php vc9

First we need to download xdebug

Be sure to choose the appropriate version of Xdebug according to the version of PHP installed, as I am installing PHP in a Windows environment, choose to download the Windows version of PHP 5.3 VC9 TS, download the Xdebug file for Php_ XDEBUG-2.2.3-5.3-VC9.DLL,XDEBUG is configured and used as a PHP module in the form of installation.
Xdebug Installation Tips: If you do not know the version of PHP installed, you can use Phpinfo (), function view, and Xdebug also provides Phpinfo output information analysis tool to help you analyze how to install Xdebug, as long as the Phpinfo output information replication submitted , Address: Xdebug phpinfo Information Analysis Address
Install Xdebug:
Copy the downloaded Php_xdebug-2.2.3-5.3-vc9.dll to the ext directory in the PHP installation directory, and my D:\amp\php\ext,ext directory is dedicated to the PHP extension library DLL file.
Configuration php.ini:
The final step in installing Xdebug is to configure the php.ini file, open the php.ini configuration file under the D:\amp\php directory, and add it at the end:

[Xdebug] ; module Path zend_extension= "D:/amp/php/ext/php_xdebug-2.2.3-5.3-vc9.dll"

PHP5.3 before version configuration Xdebug use Zend_extension_ts "C:/php/ext/php_xdebug-2.2.3-5.3-vc9.dll", for PHP5.3 above, use Zend_extension. )
Below we need to make some basic configuration of xdebug, the default xdebug PHP function automatic tracking (auto_trace) function, the parser function is not turned on, as the need to debug PHP code, some xdebug configuration options are best to open. Prior to this we need to create a directory of Xdebug auto-tracking and parser output files, make sure the directory is readable and writable,
I created the Xdebug\trace and Xdebug\profiler directories under D:\amp\apache\htdocs. Finally, in the php.ini configuration file to complete the Xdebug configuration work, found:

 [ xdebug  ]  ;   module path  zend_extension= "D:/amp/php/ext/php_xdebug-2.2.3-5.3-vc9.dll"  After this, add the Xdebug configuration Info code: Xdebug.auto_trace  =1xdebug.collect_params  =1< Span style= "color: #000000;" >xdebug.collect_return  =1xdebug.profiler_enable  =1xdebug.trace_output_dir  = "D:\amp\apache\htdocs\xdebug\trace"  Xdebug.profiler_output_dir  = "D:\amp\apache\htdocs\xdebug\profiler" 

Finally save the php.ini and restart the Aapche server.

Xdebug Partial configuration Options Description:
Xdebug.auto_trace = 1
Whether to allow Xdebug trace function calls, trace information is stored as a file, the default value is 0
Xdebug.collect_params = 1
Whether the Xdebug trace function parameter is allowed, the default value is 0
Xdebug.collect_return = 1
Whether the Xdebug trace function return value is allowed, the default value is 0
xdebug.profiler_enable = 1
Open Xdebug Performance Analyzer, stored as a file, this configuration cannot be configured with the Ini_set () function, the default value is 0
Xdebug.profiler_output_dir
Where the profiling file is stored, the default value is/tmp
Xdebug.trace_output_dir
function call trace information output file directory, default value is/tmp
The following can also be set:
Xdebug.profiler_output_name
A naming convention for profiling files, with a default value of cachegrind.out.%p
Xdebug.trace_output_name
function call trace information output file naming convention, default is trace.%c
Special Note: Xdebug's trace and Profiler's output file name rules can be changed, such as the name of the file named for the specific tracking php execution file name, process ID, random number, etc., very convenient, more xdebug configuration options description, Please refer to the XDEBUG configuration option Description on the official website. This is the installation and configuration of the PHP debugging tool xdebug Tutorial Xdebug.
Here is the configuration information for my PHP5.3 (you can copy the following as well):

[Xdebug];Module Pathzend_extension= "D:/amp/php/ext/php_xdebug-2.2.3-5.3-vc9.dll";whether to turn on automatic trackingXdebug.auto_trace= on;whether to collect parametersxdebug.collect_params= on;whether to collect return valuesxdebug.collect_return= on;whether to turn on debug contentxdebug.profiler_enable=Onxdebug.profiler_enable_trigger= on;Trace Output PathXdebug.trace_output_dir= "D:\amp\apache\htdocs\xdebug\trace";Debug Output PathXdebug.profiler_output_dir= "D:\amp\apache\htdocs\xdebug\profiler"Xdebug.profiler_output_name=cachegrind.out.%t.%p;whether to turn on remote debuggingxdebug.remote_enable= on;client IP allowed for debuggingxdebug.remote_host=127.0.0.1;Ports for remote debugging (default 9000)xdebug.remote_port=9000;Debug Plugin DBGPXdebug.remote_handler=DBGP;whether to turn on exception trackingXdebug.show_exception_trace= on;whether to turn on remote debugging auto-Startxdebug.remote_autostart= on;whether to collect variablesXdebug.collect_vars=on

Zendstudio Configuration Xdebug

1. Open ZS, expand Windows, then Preferences, PHP, click PHP Executables, click the Add button,

Fill in the Parameters , then click OK

2. Next, configure debug, expand Windows, click Preferences, PHP, click Debug, the parameter settings are as follows:

Then click OK to finish

Xdebug Debug Environment Configuration

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.