Prev Next

The PHP Debugger

The Enterprise Architect PHP Debugger enables you to debug PHP.exe scripts. This section discusses basic setup and the various debugging scenarios that are commonly encountered; the scenarios concern themselves with the mapping of file paths, which is critical to the success of a remote debugging session.

  • Script Setup
  • Local Windows Machine (Apache Server)
  • Local Windows Machine (PHP.exe)
  • Remote Linux Machine (Apache Server)
  • Remote Linux Machine (PHP.exe)

Setup and Scenarios

Scenario

Details

See also

Script Setup

An Analyzer Script is a basic requirement for debugging in Enterprise Architect; you create a script using the toolbar of the Execution Analyzer.

Select PHP.XDebug as the debugging platform; when you select this platform the property page displays these connection settings:

  • host - localhost - The adaptor that Enterprise Architect listens on for incoming connections from PHP
  • localpath - %LOCAL% - Specifies the local file path to be mapped to a remote file path; this is a remote debugging setting - for local debugging, clear the value, the value is a placeholder and you should edit it to fit your particular scenario
  • remotepath - %REMOTE% - Specifies the remote file path that a local file path is to be mapped to; this is a remote debugging setting - for local debugging, clear the value, the value is a placeholder and you should edit it to fit your particular scenario
  • logging - Enter true or false to enable logging of communication from XDebug server
  • output - names the file path on the remote machine to be used with the logging option; this file will always be overwritten

Local Machine Apache Server

In this situation, consider this configuration:

  • O/S: Windows7
  • Network computer name: MyPC
  • Network share MyShare mapped to c:\myshare
  • Source files in Enterprise Architect have been imported from c:\myshare\apache\myapp\scripts
  • Apache document root is set to //MyPC/MyShare/apache

In this scenario an Analyzer Script for the connection parameters might be configured as:

  • host: localhost
  • port: 9000
  • localpath: c:\myshare\apache\
  • remotepath: MyPC/MyShare/apache/

Local Machine PHP.EXE

In this scenario an Analyzer Script for the connection parameters might be configured as shown, as file paths always map to same physical path:

  • host: localhost
  • port: 9000
  • localpath:
  • remotepath:

Remote Linux Machine Apache Server

In this situation consider this configuration:

  • Local Machine
  • O/S: Windows7
  • Source files in  Enterprise Architect have been imported from c:\myshare\apache\myapp\scripts
  • Remote Machine
  • O/S: Linux
  • Apache document root is set to home/apache/htdocs
  • Source files in Apache are located at home/apache/htdocs/myapp/scripts

In this scenario an Analyzer Script for the connection parameters might be configured as:

  • host: localhost
  • port: 9000
  • localpath: c:\myshare\apache\
  • remotepath: home/apache/htdocs/

Remote Linux Machine PHP.exe

In this situation consider this configuration:

  • Local Machine
  • O/S: Windows7
  • Source files in Enterprise Architect have been imported from c:\myshare\apache\myapp\scripts
  • Remote Machine
  • O/S: Linux
  • Source files in Apache located at home/myapp/scripts

In this scenario an Analyzer Script for the connection parameters might be configured as:

  • host: localhost
  • port: 9000
  • localpath: c:\myshare\apache\
  • remotepath: home/

PHP Global variables

When you are at a breakpoint, you can examine the values of PHP globals using the Analyzer Watch window. To list every global, type either 'globals' or 'superglobals' into the field. To show an individual item, enter its name. This image shows the value of the PHP environment variable $_SERVER being displayed.

Learn more