Table of Contents

Debug PHP with xdebug

Refer: http://wiki.uniformserver.com/index.php/Uniform_Server_PHP_IDE:_XDebug_Overview

xdebug architecture

PHP Cli Debugging


The PHP extension php_xdebug.dll seamlessly installs code to provide interpreter control and communication between a client (Notepad++ with DBGp plugin installed in the IDE) and the PHP interpreter over port 9000. Effectively php_xdebug.dll includes a mini server to provide communication with a client.
Sequence of events

Notes:

Web page Debugging


The second server is created using a PHP extension (php_xdebug.dll). It seamlessly installs code to provide communication between Apache and a client (Notepad++ with DBGpplugin installed) over port 9000. In addition, code is installed to monitor browser requests arriving on the standard Apache port 80.
Sequence of events(Assumes Uniform Server running (Apache server running))

Config and run xdebug on windows

Check and download xdebug dll

config and check

config

[php.ini]

[Xdebug]
zend_extension="c:\Program Files (x86)\PHP\ext\php_xdebug-2.2.5-5.3-vc9.dll"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

check

Config tracing of function calls

Normal config:

xdebug.auto_trace=On
xdebug.trace_output_dir=c:\data

Custom config:
xdebug.collect_assignments: Default value 0, controls whether Xdebug should add variable assignments to function traces

xdebug-trace-gui

web config

Use xdebug gui

using http://xdebug.babies.vn/noutrace.php



log structure in xdebug

drupal example code run

parser xdebug log of drupal

Get full log of 1 function with sub-functions