Debugger (with Xdebug)

Depending on your installation, Xdebug might need some configuration:

Listener port

This is the port PHPEdit is listening on for Xdebug debug sessions.

If you are using PHPEdit's internal server and didn't change the PHP CGI setting, then can you leave this setting to it's default. Otherwise it should match the xdebug.remote_port setting in the php.ini of your server.

If you are using a proxy you can use any value you want as long as it is not already used by another application.

Using a proxy

Xdebug's module initiates debug sessions by connecting to one configured host, and one only. If the server is on your machine, or if you are the only one using the server Xdebug is installed on, this is not a problem: you simply configure Xdebug to suit your needs. The communication will be like this one:

However if several developpers are using the same server, a proxy needs to be running to transfer communications from the Xdebug module to the right PHPEdit. Communication is as follow:

The proxy is called a DBGp proxy, DBGp being the name of the protocol used by Xdebug and PHPEdit to communicate.

This proxy can be found in "<PHPEditInstallDir>\Extensions\DBGp" in 2 versions: DBGpProxy.exe for Windows and DBGpProxy for linux. It can run on any machine of the network, as long as it is accessible by the Xdebug module and by the PHPEdit installations that are supposed to use it.

Warning: Do not run the proxy on a public server , it is intended for local network debugging only and could cause a security breach!

Configuring the Xdebug module on the server

If you are want to use the debugger with an external server, you need to install the Xdebug module and configure it. You can download it from the official site.

Copy the module to PHP's ext directory, and add these lines to the php.ini file:

zend_extension_ts="c:/Program Files/WaterProof/PHPEdit/2.10/php/ext/php_xdebug.dll"
xdebug.remote_enable=on
xdebug.default_enable=off
zend_extension="/full/path/to/your/extension/php_xdebug.dll"
 xdebug.remote_enable=on
xdebug.default_enable=off

Caution: Make sure your enter an absolute full path to the module for the zend_extension or zend_extension_ts setting! Also make sure that the module is named php_xdebug.dll or php_xdebug.so.

Local single user configuration

If the server is located on the same machine as PHPEdit, you're not required to configure anything else. However you can add the following line:

xdebug.remote_autostart=on

This will force Xdebug to start a debug session for every request that is done on this server, without having to specify in the request that a debug session is wanted.

To specify manually that a debug session is wanted, just add XDEBUG_SESSION_START=PHPEdit to the url. PHPEdit adds it automatically when you start a session from the IDE.

Remote single user configuration

If the server is located on an other machine, you need to specify to the Xdebug module the IP address of the machine on which PHPEdit is installed:

xdebug.remote_host=<PHPEdit's machine IP>

If you don't want PHPEdit to listen for debug sessions on the default port (9000), you can configure it here:

xdebug.remote_port=<port>

as well as in PHPEdit.
The previous remarks on xdebug.remote_autostart are applicable here too.

Multiple user configuration

If several developpers are using the same server for debugging, you need to configure the Xdebug module to contact the proxy:

xdebug.remote_host=<Proxy's machine IP>

If you don't want the proxy to listen for debug sessions on the default port (9000), you can configure it here:

xdebug.remote_port=<port>

You need also to configure PHPEdit to use this proxy: Check the Use a DBGp Proxy option, and enter the proxy's machine IP and what port it is listening.

Note: the Proxy listens on 2 different ports: One (9000 by default) for the Xdebug module, and the other (9001 by default) for PHPEdit clients registering to the proxy.

To debug with a proxy PHPEdit needs to register to the proxy. This is done automatically when the option Use a DBGp proxy is checked. A key is then generated and will be used to identify PHPEdit for the debug sessions. If you want to launch a debug session manually in your browser, you should add XDEBUG_SESSION_START=<generated key> has parameter to the request. PHPEdit does this automatically when you start a debug session from the IDE. When you use this parameter and a debug session is started by Xdebug, a cookie is generated in your browser and you don't need to add the parameter for 1 hour.


eZ publish™ copyright © 1999-2005 eZ systems as