Windows XDebug manual configuration and instructions

  • 2020-03-31 20:57:30
  • OfStack

1. Download XDebug binaries: http://www.xdebug.org/download.php
5.2 http://www.xdebug.org/files/php_xdebug-2.1.0-5.2-vc6.dll
5.3 http://www.xdebug.org/files/php_xdebug-2.1.0-5.3-vc6.dll
2. Find a PHP. Ini
3. If you have ZendOptimizer, you need to hide the ZendOptimizer configuration. It is usually as follows:
[Zend]
Zend_extension_manager. Optimizer_ts = "path \ ZendOptimizer - 3.3.0 \ lib \ Optimizer - 3.3.0"
Zend_extension_ts = "path \ ZendOptimizer - 3.3.0 \ lib \ ZendExtensionManager DLL." "
4. Add XDebug configuration:
Zend_extension_ts = "path/xdebug/php_xdebug - 2.1.0-5.2 - vc6. DLL." "
[Xdebug]
Xdebug. Profiler_enable = on
Xdebug. Trace_output_dir = "path \ xdebug"
Xdebug. Profiler_output_dir = "path \ xdebug"
Xdebug. Remote_enable = on
Xdebug. Remote_handler = DBGP
Xdebug. Remote_host = localhost
Xdebug. Remote_port = 9000
Note: the "path" above needs to be changed to your own local path.
5. Restart Apache or IIS.
6. Look at the output of phpinfo, and if you see the options for XDebug, the configuration is successful.
The following are other netizens' articles
1. Install the xdebug module
1, go to www.xdebug.org to download the corresponding version of PHP module file, save the downloaded file to the PHP ext directory, you can change the name of the file, such as save: php_xdebug.dll
2. Modify php.ini to 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. You cannot use extension=php_xdebug.dll to load it, you must load it in zend mode, otherwise after installation, phpinfo will not show xdebug.
Xdebug.auto_trace = on.
; Automatically opens the "monitor function call procedure" module. This feature outputs the monitor information of the function call as a file in the directory you specify. The default value for this configuration item is off.
Xdebug. Collect_params = on;
; Turns on the collection of 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 item is off.
Xdebug. Collect_return = on
; Turns on the collection of 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 item is off.
Xdebug. Trace_output_dir = "c: \ Temp \ xdebug"
; Sets the path to the output file for the function call monitoring information.
Xdebug. Profiler_enable = on
; Turn on the performance monitor.
Xdebug. Profiler_output_dir = "c: \ Temp \ xdebug";
; Set the path of the performance monitoring information output file.
There are some more specific parameter setting, see: http://www.xdebug.org/docs-settings.php
3. Restart apache
This way, when running PHP locally, it will generate some debug information files in the specified directory:
The file name format of the function call process monitoring information file: trace. X x x x x x xt. This file can be directly viewed, which contains the function run time, function call parameter value, return value, the file and location of information. The content format is still relatively straightforward.
File name format of the performance monitoring file: cachegrind. Out. X x x x x x x .
This file can also be viewed directly, but the format of the information is not easily understood by humans,
So we need the next piece of software.
Install wincachegrind
Since the contents of the cachegrind. Out. Windows has one such software: wincachegrind.
1, to download and install wincachegrind at http://sourceforge.net/projects/wincachegrind/
2. After installation, click Tools-> Options, set your working folder(value of xdebug.profiler_output_dir in php.ini)
This can be more intuitive to see the performance monitoring file information.


Related articles: