xdebug and eclipse pdt

InstallXDebug


1. Go tohttp://www.xdebug.org/;downloadXdebug(version 2.0.3 at the time of this writing).
2. Putphp_xdebug-2.0.3-5.2.5.dllyou just downloaded to some folder; Add the following line tophp.inifile so that PHP can load it:

[xdebug]
zend_extension_ts="D:/ProgramFiles/PHP5.2/modules/php_xdebug-2.0.3-5.2.5.dll"
xdebug.remote_enable=On
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_log="d:/xdebug.log"

Ensure you place your entries at the bottom of your php.ini file or XDebug could fail to load.

You may need to change the “zend_extension_ts” to “zend_extension” if you are using the non thread safe version of PHP or to “zend_extension_debug” if you are using the debug version. This information can be found by running phpinfo() and locate the following section:
Debug Build => no
Thread Safety => enabled

3. TestingXDebug is installed correctly byCallphpinfo()function in a page, or run this:
php -m
You should be able to see a section for XDebug if successfully installed.

Configure PDT to Use XDebug


1. Configure PHP Executables in
Windows > Preference > PHP > Debug.


2. Configure PHP Server for debugging Web Pages. (You can refer to the "Add Virtual Host" of the part 1, which configures the current project tobe a Virtual Host.)


3. Configure the default debug settings to use XDebug.


4. Next we configure the debug settings for the current project. First go to
Run > Open Debug Dialog...
5. Next we create a newPHP Scriptconfiguration.


6. Then we create a configuration for debuggingPHP Web Page.


7. Now create some test php script/pages, click on the "Debug" button to start debugging.


Reference


XDebug Guide
http://www.eclipse.org/pdt/documents/XDebugGuide.pdf
How To Setup a Free PHP Debugger using Eclipse PDT + XDebug
http://robsnotebook.com/php_debugger_pdt_xdebug
Debugging PHP applications with xdebug
http://devzone.zend.com/article/2930-Debugging-PHP-applications-with-xdebug

Debugging PHP using Eclipse PDT + Zend Debugger / Xdebug
http://www.ibm.com/developerworks/edu/os-dw-os-php-eclipse-pdt-debug.html
Debugging PHP Applications with Xdebug and Eclipse PDT
http://www.64bitjungle.com/tech/debugging-php-applications-with-xdebug-and-eclipse-pdt/
Squash bugs in PHP applications with Xdebug
http://www.ibm.com/developerworks/opensource/library/os-php-xdebug/?S_TACT=105AGX44&S_CMP=TUT

猜你喜欢

转载自qinglianluan.iteye.com/blog/2004439