Thursday, March 24, 2011

XDebug issue: Unexpected termination of script, debugging ended

I spent the better part of a day trying to figure out why I could debug a PHP script in Eclipse one minute and the next not at all. Hopefully this will help someone else out too.

My setup is Eclipse Helios PDT and WAMPServer 2.1 with PHP 5.3.5 and XDebug 2.1. I had no problem debugging scripts and then one day, poof! I started getting "Unexpected termination of script, debugging ended" messages and could not step through code at all.

As it turns out there appears to be a bug in the PDT (I can recreate this with multiple XDebug versions) with using XDebug and the Watches panel if you have some watches defined. To get around the error (I don't know if there's a fix) just remove all your watches before debugging by right-clicking on the watches view in the PHP debug perspective and choose "Remove All Watches".

This fixed it for me and I hope it will for you too.

Dummy Coder

3 comments:

  1. Thank you!!!!! this one saved me today.

    ReplyDelete
  2. Still encountering the same issue, with the same fix, in 2013 with Eclipse Juno btw.

    ReplyDelete
  3. I was also getting the error when clicking on the variables panel. Upgrading to xdebug version 2.2.2 did the trick

    ReplyDelete