Overview
KB
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
Technical FAQ
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Install debugger moduleSetup remote debugging>
Last updated: Thu, 03 Feb 2011

HOWTO: Run debug session?

I. IDE
If you you have a project created in the PhpED IDE and use HTTP with 3rd party web server (run mode) or if this run mode is set to "SRV local WEB server" or "Local CGI", you can open PHP script your want to debug in the editor and click "Run in debugger (F9)":



After debug session is finished and you get your page rendered in the browser all subsequent clicks on URLs or submit buttons will run next debug session. To avoid this behaviour you can uncheck Tools->Settings->Debugger->Debug session.
NOTE: if submit or navigation is done to a different domain name or with different protocol used (HTTPS vs HTTP) debug session won't run

II. Debugger Toolbar
You navigate to a page using Internet Explorer browser and click Debug button on the toolbar:



After debug session is finished and you get your page rendered in the browser all subsequent clicks on URLs or submit buttons will run next debug session. To avoid this behaviour you can uncheck Debug->Session in the toolbar.

III. Other ways
Alternatively there are some other ways to run debug session for a script that is executed from POST or GET request or if in other words the first page is a plain HTML (without PHP):



1. you can add debug session request to the form where you run POST or GET. For example:
HTTP POST:
<form ....>
<input type=hidden name=DBGSESSID value="1;d=1">
...
</form>

HTTP GET:
http://myhost/myscript?DBGSESSID=1;d=1


2. header("Location: http://mywebhost/myscript.php?DBGSESSID=1;d=1");
Note: in case of dbg prior to version 2.16, line above should be corrected to
header("Location: http://mywebhost/myscript.php?DBGSESSID=1@clienthost:7869")

3. Command line argument:
php-cgi myscript.php DBGSESSID=1@192.168.0.55;d=1

where 192.168.0.55 is IP address of client machine where you run the IDE In case if you use SSH tunnel for remote debugging, the address is always 127.0.0.1 or localhost. See this topic for further details about DBGSESSID syntax

4. add DebugBreak() function call in appropriate location in the script. This function accepts one optional argument - a debug session request, for example
DebugBreak('1;d=1')

See this topic for DBGSESSID syntax.


<Install debugger moduleSetup remote debugging>
Last updated: Thu, 03 Feb 2011