Remote Debugging via proxy with PHP, XDebug, and Komodo IDE

So I am experimenting with remote debugging using Komodo IDE, PHP and Linux.  Following instructions from the xdebug website, I typed:

sudo pecl install xdebug

Then I added the file /etc/php.d/xdebug.ini with the lines:

extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

Running php -i, yields amongst others, the following message:

xdebug support => enabled
Version => 2.1.1

XDEBUG NOT LOADED AS ZEND EXTENSION

Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.145 $

All good so far. Now I need to set up the debugging proxy server on the webserver host so that multiple developers can debug scripts from the same dev webserver.

To do this, I followed the instructions provided by Komodo using their python-based proxy server:

export PYTHONPATH=/lib/support/dbgp/pythonlib;$PYTHONPATH
cd /lib/support/dbgp/bin
python pydbgpproxy -i 138.77.20.48:9001 -d localhost:9000 -l DEBUG

So now I have configured Komodo to use the proxy server for debugging.

Komodo debugger options

Now to initiate a debugging session with a website script, I followed the instructions provided by Komodo:

Click Debug | Listen for Debugger Connections

Then in the browser, enter the URL of the script and append: ?XDEBUG_SESSION_START=damo

Now Komodo asks to start a debug session where I click Yes, and …. The script completes and no debugging occurs. 😦

Seems more investigation is required here.

I am wondering whether the ajax calls in the script I am attempting to debug are confusing the proxy and or Komodo? Each ajax call will also have the cookie set for debugging and so there are multiple requests do debug with the same Komod instance. Perhaps this is why the debugger is not working.

I am hopeful I can get this working. Will save alot of time trying to find those nasty bugs.

Damien.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: