How to debug PHP with netbeans and Xdebug

Jon Winstanley picture Jon Winstanley · Mar 28, 2009 · Viewed 46.9k times · Source

I have recently tried to get going with Netbeans 6.5 after it rated so highly in the IDE review by Smashing magazine. http://www.smashingmagazine.com/2009/02/11/the-big-php-ides-test-why-use-oneand-which-to-choose/

My main reason for switching from Notepad++ is that I'd like to be able to debug my code and set through it.

I have followed the instructions about how to install xdebug from both the vendor http://xdebug.org/ and the netbeans web site. http://www.netbeans.org/kb/docs/php/debugging.html#gettingReady but to no avail.

How is it done, has anyone else got debugging working in netbeans?

(My setup is: Windows XP, Wamp server 2.0, PHP 5, Netbeans 6.5.1)

Answer

openfrog picture openfrog · Dec 22, 2009

It's important to add this line in the php.ini:

xdebug.idekey="netbeans-xdebug"

Note: In NetBeans go to Settings and look where the xdebug stuff is set up. Look for that Session ID. In my case it was netbeans-xdebug.