Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Sunday, February 13, 2011

Debugging PHP in Eclipse with XDebug

I got the following error message when I tried to debug a PHP project in Eclipse.

"Unexpected termination of script. Debugging ended."

By looking into the log of XDebug, I found out that this error is actually a timeout of XDebug trying to connect back to the debugging client (in my case, Eclipse). I checked the firewall policy in my system (Windows 7) and it turned out that the inbound connections to Eclipse were all blocked by rule. After I allowed them, this problem was solved.

Monday, January 31, 2011

Installation of XDebug and PDT

Sever side

1. Install XAMPP
2. Download the latest XDebug PHP debugger from http://www.xdebug.org/download.php (XAMPP requires VC 6 thread-safe version) and overwrite xampp\php\ext\php_xdebug.dll.
3. Modify php.ini by uncommenting and setting the following options in XDebug section:
zend_extension = ;
xdebug.remote_enable = 1;

Client side

1. Install PDT following the instructions on http://wiki.eclipse.org/PDT/Installation
2. Configure options related to PHP debugging. Reference can be found on http://www.eclipse.org/pdt/documents/XDebugGuideForPDT2.0.pdf