views:

511

answers:

1

Hi guys,

Have tried for quite some time to get this to work correctly but to no luck. Basically, I have Eclipse (3.3) with PHP Development Tools (PDT), and the PDT XDebug plugin as well as the SimpleTest eclipse plugin.

What I want to do is debug code invoked by SimpleTest unit tests. SimpleTest clearly can see XDebug, because I can generate code coverage reports, but it just won't stop on breakpoints.

Edit: Should add that XDebug and breakpoints work fine in eclipse, just not when invoked by SimpleTest

Has anyone set this up successfully? There's a lot of guff docs around and little in the way of useful information.

Thanks!

+1  A: 

Make sure you have the right XDebug version for your version of PHP and add this at the very beginning of your php.ini file:

[xdebug]
zend_extension=full_path_to_your_xdebug.so 
xdebug.default_enable=On
xdebug.remote_enable=On
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_port=9000

Then do an apachectl graceful and a phpinfo and make sure XDebug is present and active. If it is, everything should work fine. I know it does for me.

edit: I answered before reading the entire question.

before running the script you should set the environment variable;

export XDEBUG_CONFIG="idekey=session_name"

It might be possible to do this from php but i cannot test this:

putenv('XDEBUG_CONFIG="idekey=session_name"');

You should make sure that the php binary you are using has the XDebug extension loaded, on my system the apache module has it, but the default CLI interpreter does not, but I run different versions on purpose.

There's some good documentation here

Kris