![]() |
|||||
XDEBUG EXTENSION FOR PHP | DOCUMENTATION - DEBUGGER home | updates | installation | documentation | screenshots | license | support
> General: Configurating Settings,
Functions
> Profiling: Xdebug 1, Xdebug 2 > Debugger: Usage, GDB Protocol, DBGp Protocol > FAQ: Frequently Asked Questions > Download Documentation INTRODUCTION Xdebug's (remote) debugger allows you to examine data structure, interactively walk through your and debug your code. There are two different protocols to communicate with the debugger: a GDB-like command protocol (GDB) which is implemented in Xdebug 1.3 and 2; and the DBGp protocol which is implemented in only Xdebug 2. CLIENTSA simple commandline client for the GDB protocol is bundled with Xdebug 1.3. A client implementation can also be found in the free editor WeaverSlave and in Maguma's WorkBench. Xdebug 2 is bundled with a simple commandline client for the DBGp protocol. Another client implementation of the DBGp protocol can be found in the next version of ActiveState's Komodo. STARTING THE DEBUGGERIn order to enable Xdebug's debugger you need to make some configuration settings in php.ini. These settings are xdebug.remote_enable to enable the debugger, xdebug.remote_host and xdebug.remote_port to configure the IP address and port where the debugger should connect to and xdebug.remote_handler to configure which debug backend to use ("gdb" or "dbgp"). If you want the debugger to initiate a session when an error situation occurs (php error or exception) then you also need to change the xdebug.remote_mode setting. Allowed values for this setting are "req" (the default) which makes the debugger initiate a session as soon as a script is started, or "jit" when a session should only be initiated on an error. After made all those settings Xdebug will still not start a debugging session automatically when a script is run. You need to activate Xdebug's debugger and you can do that in two ways:
Before you start your script you will need to tell your client that it can receive debug connections, please refer to the documentation of the specific client on how to do this. To use the bundled client simply start it after compiling and installing it. You can start it by running "debugclient". If you want to use the GDB commandset to debug your scripts, make sure you use a debugclient as bundled with Xdebug 1.3 as the one bundled with Xdebug 2 only works with the DBGp commandset. When the debugclient starts it will show the following information and then waits until a connection is initiated by the debug server: Xdebug Simple DBGp client (0.8.0) Copyright 2002-2004 by Derick Rethans. - libedit support: enabled Waiting for debug server to connect. After a connection is made the output of the debug server is shown: Connect <init fileuri="file:///home/derick/foo5.html" language="PHP" protocol_version="1.0" appid="27010"> <engine version="2.0.0dev">Xdebug</engine> <author>Derick Rethans</author> <url>http://xdebug.org</url> <copyright>Copyright (c) 2002-2004 by Derick Rethans</copyright> </init> (cmd) Now you can use the commandset as explained on the GDB or DBGp documentation page. When the script ends the debug server disconnects from the client and the debugclient resumes with waiting for a new connection. HTTP DEBUG SESSIONSXdebug contains functionality to keep track of a debug session when started through a browser: cookies. This works like this:
|
|
||||
This site and all of its contents are
Copyright © 2002, 2003, 2004 by Derick Rethans.
All rights reserved. |