Next Previous Contents

3. Usage

3.1 PHP Debugger Quickstart

There are a few things that need to be set up correctly before PHP debugging will work. This is a bit painful, but it is a one-time activity and once done you'll never have to worry about it again!

Build and Install the Debug Monitor

See the INSTALL file in the phpdbg distribution for details.

Configure the Debug Monitor

A PHP interface has been provided for configuration. You need to:

Create a directory under your web servers root and copy the .php files from the config directory within the phpdbg distribution Edit the php.ini file on the web server and add an entry

nexidion_config=<full path and filename for nexidion config file>
You can name the config file anything you like - a typical value would be '/home/httpd/nexidion/nexidion.conf' to use a file called 'nexidion.conf' in the /home/httpd/nexidion directory. As with other configuration files, it is recommended that you put this file outside your web server's document tree. It is important the the web server has full rights to this file and sufficient rights to create a backup file alongside it.

Now from a browser, access the cfgmain.php page. You will see four columns titled Remote IP, Path, Debug IP and Active and a link titled 'Add'. Click on this link to add a new configuration entry. The configuration model is that when the machine identified by 'Remote IP' requests a file whose path begins with the corresponding path entry then the request will be debugged on the machine identified by 'Debug IP'. Note that the path must be a full path and describes the physical location of the file on the web server rather than the path relative to the document root. You may add as many configuration entries as you like and they will be checked in turn. If none of the Remote IP/Path configurations match the current request then the request is not debugged.

Configure the Server Settings in Designer

For security reasons, Designer does not download the source code for the PHP pages that you are debugging. Instead it assumes that you already have a copy of the source code on your local machine. Before you can debug a PHP page on a remote server, you must set up a server mapping that tells Designer where on your local machine you have put the corresponding source code. To set up a server mapping, choose 'Servers...' from the 'Options' menu. In this dialog you must fill in:

  1. Server Name, in the same format that you will access it from your browser. For example, www.nexidion.org
  2. Local Path. This is the directory on your local machine corresponding to the document root for the server.
  3. Server Path. The document root directory on the server.
  4. Browser Path. Currently unused.

Hit the Add button after entering the required details and then close the dialog.

Debug!

Choose 'Go' from the 'Debug' menu to place Designer into Debug mode. Designer is now listening for debug connections, and will continue to listen until you choose 'Stop' from the 'Debug' menu. Now use a browser to request a PHP page from the web server. The corresponding source file will be displayed with the current line highlighted and the debugger will wait for your command - single step, continue execution, add new watch expressions (by right-clicking on the watch window) etc.

Troubleshooting


Next Previous Contents