Locally Debugging a PHP Script

This procedure describes how to debug a PHP Script from your workspace using an internal debugger.

PDT supports both the Zend Debugger and XDebug.

 

 

 

Instructions on how to complete a procedure

To locally debug a PHP Script:

  1. Set breakpoints at the relevant places in the file that you would like to debug by double-clicking the vertical marker bar to the left of the editor.

  2. Save the file.

  3. Click the arrow next to the debug button on the toolbar and select Open Debug Dialog –or- select Run | Open Debug Dialog.
    A Debug dialog will open.

  4. Double-click the PHP Script option to create a new debug configuration.

  1. Enter a name for the new configuration.

  2. Select the required PHP executable.
    The PHP executable used must match the PHP Executable used when creating the project.
    If no PHP Executables are listed, click the PHP Executable link and add a PHP Executable in the
    PHP Executable Preferences page. The PHP Executables must match the Debugger type.

  3. Select the PHP Debugger to be used. PDT supports both the Zend Debugger and XDebug.

  4. Under PHP File, click Browse and select your file

  5. Marking the Breakpoint checkbox will result in the debugging process pausing at the first line.

  6. Click Apply and then Debug.

  7. Click Yes if asked whether to open the PHP Debug Perspective.

A number of views will open with relevant debug information.

Click here for more on Running and Analyzing the debugging process.

 

 

Related Links

Related Links:

Working with the Debugger

Debugging

Debugging a PHP Script

Debug Preferences

Debugging a PHP Web Page

Running and Analyzing Debugger Results

Run Menu

PHP Support