PHP Debugger Checklist

This topic provides a supplementary checklist and troubleshooting guide for debugging PHP scripts in Enterprise Architect.

Topics

Topic

Detail

See also

System Requirements

Apache HTTP Web Server version 2.2
PHP version 5.3 or above
XDebug version 2.1.1

http://httpd.apache.org/

http://windows.php.net/

http://www.xdebug.org/download.php

Checklist

Enterprise Architect

The model has an Analyzer Script configured to use the PHP XDebug platform
PHP source code has been imported into the model (for recording and testpoints)
When the PHP XDebug platform is selected from the Analyzer Script dialog, default runtime settings are listed in the Connection field
localpath:%LOCAL%
remotepath:%REMOTE%
 

Either define local paths for these default variables or edit the script to provide actual paths.
 

For example: local source, remote source
 

localpath:c:\code samples\vea\php\sample

remotepath:webserver/sample
 

where:

webserver is a network or local share
sample is a folder below share

 

PHP

In order to debug PHP scripts in Enterprise Architect, it is a requirement that the PHP is configured properly to load the XDebug extension.

Settings similar to those below should be used:

[xdebug]
xdebug.extended_info=1
xdebug.idekey=ea
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
xdebug.remote_host=X.X.X.X
xdebug.remote_port=9000
xdebug.show_local_vars=1

The IP address X.X.X.X refers to and should match the host specified in the model Analyzer Script.

The IP address is the address XDebug connects with and the same address the Enterprise Architect PHP agent listens on.

 

 

Apache

For debugging using Apache, the following lines should be present in the Apache configuration file, httpd.conf:

LoadModule php5_module "php_home/php5apache2_2.dll"
AddHandler application/x-httpd-php .php

PHPIniDir "php_home"

 

where php_home  is the PHP installation path (the path where php.ini and apache dll exist).

 

 

Troubleshooting

To prevent both PHP and Apache timeouts during a debugging session, the settings below might require modification.

These settings were used while developing the PHP Debugging agent in Enterprise Architect.

 

 

PHP

File: php.ini

; EA prevent PHP timeouts when debugging PHP extensions
max_execution_time = 0
 

; EA prevent web server timeouts when debugging PHP extensions
max_input_time = -1
 

; EA log errors
display_errors = On
 

; EA display startup errors
display_startup_errors = On

 

 

Apache

File: httpd.conf

; EA prevent timeouts while debugging php extensions
Timeout 60000

 

 

Learning Center topics

(Alt+F1) | Build and Debug | Debug | PHP Samples
(Alt+F1) | Build and Debug | Debug | PHP