Friday, June 19, 2009

Eclipse can not debug PHP web page (session terminated)

When using Eclipse with PDT to debug PHP, it can successfully debug PHP script, but everytime when tring to debug PHP webpage, it will terminated quickly with information saying of "session terminated".

The reason is because there are 3 lines must be added in php.ini.

zend_extension_ts="C:\Program Files\PHP\ext\ZendDebugger.dll" (You need to search in your Eclipse folder to find out where the file exists and use the full path to it.)
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always

After adding these 3 lines, restart Apache, then it works.

2 comments:

Anonymous said...

A php script is not automatically debugged here (Eclipse Helios + (PDT + Zend Debugger) plug-in.
But the two other setting variables
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always
in the right php.ini made it.
Of course, zend_extension="C:\Eclipse Helios\eclipse\plugins\org.zend.php.debug.debugger.win32.x86_5.3.18.v20100905\resources\php53\ZendDebugger.dll" is also needed

Thanks

clod said...

I suggest to try Codelobster to debug PHP code.

Search

Google