The dbg debugger must be instructed to start a debugging session. When it receives this command, it will attempt to communicate with dbg Listener. For the debugging session to start, a DBGSESSID variable must be passed along with the HTTP request using GET, POST, or as a cookie.
A typical DBGSESSID looks like this: 1234@clienthost:7869;d=1,p=1 There are four main parts:
1. The ID ( 1234 @clienthost:7869;d=1,p=1)This is a unique identifier for the dbg session. It may be any positive integer. If there will be more than one user debugging at the same time, then this id should be unique for each user.
The IP address of the client host (1234@ clienthost :7869;d=1,p=1)
This can be a hostname (example.com), IP address (192.168.1.110), a network name (MyComputer), localhost, or clienthost. The clienthost option instructs dbg to try to determine the IP address of the client host automatically. The dbg debugger contains a small bug when detecting the client IP address in a one machine configuration where the local loopback address is not 127.0.0.1. The dbg debugger incorrectly interprets "localhost" and "clienthost" as 127.0.0.1. Users who use other loopback addresses should use the address in this section (ex. 1234@ 10.0.0.1 :7869;d=1,p=1).
The Port that DBG Listener is listening to on the client host (1234@clienthost: 7869 ;d=1,p=1)
The default port is 7869. If the client machine is behind a NAT device, this port should be forwarded. Make sure that this port is not being blocked by a firewall.
4. Options (1234@clienthost:7869; d=1,p=1)There are two options, separated by a comma. The "d" option controls whether or not debugging information is sent. For proper operation, it should always be set to 1. The "p" option controls the sending of profiling information. It should be set to 1 if the user desires to use the profiler, otherwise setting it to 0 will slightly decrease traffic.
Methods of setting the DBGSESSID variable
The DBGSESSID variable can be read from GET, POST, or COOKIE.
To use GET, add the correct DBGSESSID string for your configuration to the query string of the page you wish to debug. (ex. http://www.example.com/debugme.php?DBGSESSID=1234@clienthost:7869;d=1,p=1
To use POST, add a text or hidden field name "DBGSESSID" to a form that contains the correct DBGSESSID string for your configuration as the value. Debugging will start on the page the form is submitted to.
To use a cookie, the PHP script should set a cookie using setcookie(). The debugging session will start on the page view after the page which initially set the cookie.
setcookie ("DBGSESSID", "1234@clienthost:7869;d=1,p=1");