Debugging Drupal with Eclipse

26 Nov

Debugging Drupal with Eclipse

in debug, Drupal, Drupal, Drupal Planet, Drupal Planet

This was one of the most frustrating setups for me, not because it is difficult, but because it is very important to get the xdebug library absolutely correct. For a long time it seemed that everyone could debug but me. There were no posting pointing to the problems I was having, so here it is: I have a wamp install with Eclipse. I am running php5.2.9-2. This is important to know because the library has to match the php version.

1. For this version of php, I downloaded the debug library : http://xdebug.org/files/php_xdebug-2.0.4-5.2.8.dll . There are several libraries listed on the site, and the hard part was to get to the right one.

2. This file was copied to <something>\wamp\bin\php\php5.2.9-2\ext

3. Next: edit the php.ini: Mine looks like following:

zend_extension_ts="C:\wamp\bin\php\php5.2.9-2\ext\php_xdebug-2.0.4-5.2.8.dll"
xdebug.remote_autostart=off
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
 
4. Restart server (WAMP)

5. Run command (type in the URL on the browser) http://localhost/?phpinfo=1 - you are running phpinfo(). This should display all the properties for you. You should see something for Xdebug on the displayed page.

6. If it does, your server is configured. Client configuration is straightforward: On Eclipse, under debug configuration, I selected "Server Debugger" to be XDebug from the drop down And the debug type is php web page. So you have to create e new php web page, give it a name and start debugging. Let me know if you have questions. I can feel the pain of debug setup.

Happy Drupaling :)

copyright 2012 10jumps Llc.

copyright 2012 10jumps LLC.