PHP adds methods for Xdebug extensions

  • 2020-12-22 17:36:06
  • OfStack

xdegug is a good php debugging extension, and the installation method is very simple, basically similar to other extension installation methods.

1. Download corresponding DLL

Download address: https: / / xdebug org/download php inside choose corresponding php version and windows 32/64 version

2. You can also customize the file by placing it in the ext folder under the PHP installation directory.

3. Modify php. ini

 
[Xdebug]
zend_extension="./ext/php_xdebug-2.2.3-5.3-vc9-nts.dll"
; Here are the parameters
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.trace_output_dir="./xdebug"
xdebug.profiler_enable=on
xdebug.profiler_output_dir="./xdebug"

Configure the instance

[

[Xdebug]
;zend_extension_ts = "X:\upupw\PHP5\ext\php_xdebug.dll"
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.auto_trace = 0
xdebug.trace_output_dir = "X:\upupw\xdebug\trace"
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = "X:\upupw\xdebug\profiler"
xdebug.max_nesting_level = 100
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp

]

Note:

xdebug.trace_output_dir="./xdebug" configuration is to place the debug files in the xdebug folder under the PHP installation directory, so create a new xdebug folder under the PHP installation directory

xdebug.profiler_output_dir ="./xdebug" configuration is to place the debug files in the xdebug folder under the project you are running, so create a new xdebug folder under the project directory

Restart the web server and check echo phpinfo() to see if there is an xdebug extension.

test

Create the php file

 
<?php
testXdebug();
function testXdebug() {
require_once('abc.php');
}
?>

Run to see if the xdebug folder under the php installation directory has generated a file. The generated file is installed successfully


Related articles: