Warning: You're looking at a styleless page because your browser is ignoring CSS styles. You're probably using a very old browser, or you disabled CSS support by purpose. We suggest you to download a modern browser such as Firefox or Internet Explorer.
Debugging in PHPEdit follows a client-server model. The client runs PHPEdit, the PHP dbg Listener, and in many cases a browser. The server runs web server software (usually Apache), with PHP and dbg. The client machine requests a script from the server, and the server provides the results of the script, as well as debugging information about the script to the client. PHPEdit has a flexible debugger that allows the client and server to be different machines, or the same machine. In one mode of the debugger, PHPEdit even acts as both server and client.
PHPEdit
:
PHPEdit serves as the controls for the debugger. It manages breakpoints, controls the flow of the debugging process, and exposes information about the current debug session to the user.
Web Server
:
The web server handles the request for a script to be executed and passes control of execution onto PHP. In Local CGI debugging mode, PHPEdit acts as its own web server. Common web servers include Apache HTTP Server and Microsoft Internet Information Services.
PHP with dbg
:
The dbg module hooks into PHP on the web server and communicates runtime information to the PHP dbg Listener.
dbg Listener
:
This small application acts as a bridge between the dbg module on the web server and PHPEdit. It allows PHPEdit to give commands to PHP to continue or halt execution of the script. It also communicates runtime information such as the current values of variables to PHPEdit.
The debugger can be run in two modes, each with its own advantages. For debugging simple scripts, Local CGI is useful. For complex scripts HTTP mode is required.
Local CGI
:
In this mode, the PHPEdit bypasses the web server, and directly calls a local copy of php-cgi.exe to execute the script. Debugging sessions of this type must be started from the IDE. This setup allows for debugging on a single machine without the need to install a web server. However this limits debugging to scripts that do not depend on superglobal variables such as POST, GET, SESSION, COOKIE, or SERVER, and that do not need to pass information to other scripts.
HTTP
:
This mode allows debugging to happen through the HTTP protocol. HTTP debugging sessions be started from the IDE or from a browser. Because debugging is handles using a web server, superglobals such as POST, GET, SESSION, COOKIE, and SERVER will be available. The web server may be located on a different machine as the IDE, or on the same machine. Having both on the same machine adds the advantage that files editing during a debug session will be immediately available for debugging without needing to synchronize those files with another machine. This is the recommended method of debugging scripts with PHPEdit.
In HTTP Mode, the server and client can be located on the same or different machines. In Local CGI mode, PHPEdit also functions as the web server by passing the script along to the php-cgi parser on the local machine.
The following figure helps illustrate communication in HTTP and Local CGI modes.