Debugging error of Eclipse PHP

The road for me as a long time dot net programmer to switch ‘code’ to PHP was undoubtedly a very bumpy one. Some of the things we took for granted in ASP.Net development can turn out to be struggles for other languages.

I was using Eclipse PDT with xDebug as the debugger(I have never been successful in setting up Zend debugger for Eclipse.), after a few debug sessions, I suddenly got an error when Eclipse reached the first breakpoint: Unexpected termination of script, debugging ended. I searched around, could not find any cure, it looked pretty much a dead end for my php project.

My experience working with open source tools is you do not give up easily. Even though at time I was just getting used to working in Eclipse and started enjoying it, I thought I better to give a try of another famous php IDE, Netbeans, everything was setup quickly, load the project and started debugging again. Unfortunate the luck was not long enough, the same issue comes back for Netbeans too. But it is the useful error message in Netbeans that pointed me to the solution of this problem, it was saying that this error might be caused by some of watches left in Expression panel from last debug session, and it turns out to be exactly the reason for both Netbeans and Eclipse.

Here is a screenshot of Eclipse
value watches in Expression

The solution is, close the error message box, and go to Expression view, right click, remove all watches, end this session, and start to debug again.

This entry was posted on Wednesday, July 7th, 2010 at 7:50 am and is filed under PHP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

5 Responses to “Debugging error of Eclipse PHP”

  1. djenkins22 says:

    it was very interesting to read
    I want to quote your post in my blog. It can?
    And you et an account on Twitter?

  2. gegeturambar says:

    It was working for me, thanks =D

  3. Rasika says:

    Interesting thing is I spent more than 5 hours on this, it is not just when you have items in expression window, by default if you don’t have expression window visible, then also you get this (even it is your first time of debugging and no expression items) so first make it visible by Windows->Show View->Expressions and make that window visible on your IDE

  4. Pete says:

    Thanks for this. I suspect you saved me a lot of time; like Rasika I didn’t have the expression window visible. Much appreciated.

Leave a Reply