Setting up PDT
At this point, you should have XDebug or the Zend Debugger installed and configured, and you should have verified that it is properly installed. Before you can attach to either debugger and use it with PDT, you have to make a few configuration changes to PDT to tell it which debugger to use.
When you installed PDT, you should have gotten a PHP server on which to run your projects. If you already have a default Web server set up, you can skip this section. But if you didn't, you can set up a server so you can debug PHP Web pages on your local computer.
To set up the server:
- Open the PHP server preferences, expand PHP, then click PHP Servers, as shown below.
Figure 11. PHP server preferences
- Click New to add a new server to the list.
- In Configure a PHP Server, type a name — such as
PHP Server— in the Name field, then type the base URL (for example,
- Click Next.
- Click Add to add a new path mapping (see Figure 12). You can click Browse to select a location from your workspace, then make sure the full path to the resources appears in the Path on Server field. For example, in my webDebugExample project, I have /webDebugExample in the Path in Workspace and /Users/nagood/Sites/webDebug in the Path on Server fields.
Figure 12. Adding a new server mapping
Before using the debugger, you must verify that the PHP executables are set up properly. Open the Eclipse preferences, expand PHP, then click PHP Executables, as shown in Figure 13. Here, you see a fresh installation of the bundled version of the PDT project from Zend's site; the executables are already set up, and there is nothing to do.
Figure 13. PHP Executables preferences
To add and configure a new executable, click Add. The Add new PHP Executable window appears, as shown in Figure 14. Type a descriptive name (the name can include spaces) in the Name field, then click Browse to locate the PHP executable path (that is, /usr/local/php5/bin or C:\PHP) and the php.ini file (see "Troubleshooting" for hints on locating this file if you don't know where it is).
Figure 14. Defining a PHP executable
Finally, choose the correct PHP debugger. It matters: If you choose the incorrect debugger, your project might not execute at all or could execute, but not stop at breakpoints.