Xdebug + XAMPP + Netbeans = fail. Cannot get debugger to work in Netbeans

netbeans-7xamppxdebug

I've read other questions regarding this topic. The listed solutions haven't worked.

Installed:

XAMPP 1.7.7

Netbeans 7.1.1

XDebug 2.1.4

phpinfo() shows that Xdebug is installed with all the correct parameters:

zend_extension = C:\xampp\php\ext\php_xdebug-2.1.4-5.3-vc9.dll

xdebug.remote_enable = on

xdebug.remote_handler = "dbgp"

xdebug.remote_host = "localhost"

xdebug.remote_port = 9000

However, when I start a Netbeans debug session, it cycles for awhile with no effect. When I stop it, I get the Info box informing me that "No connection from xdebug was detected with in nn seconds. The reasons could be that xdebug is not installed or not properly configured. (their emphasis).

As far as I can tell, I configured everything correctly, restarted the Apache server and it still doesn't work. I'm at a total loss on how to proceed. Any help is appreciated.

Best Answer

Can you believe it!? After spending literally HOURS researching this problem, I finally found the cause which I can only classify as a bug. Now, how do I report a bug? That's the next question.

Here's a summary:

create PHP project and setup NetBeans project site root to subfolder. (In order to not register for Apache new test site for any new task I put every new task into subfolder under my local test domain, e.g. http://test.my/project3/ ). NetBeans will not start debugging session automatically in this case. You will see a ‘waiting for connection’ message from the image below. Do not worry. Left it as it is. Go to your browser. I use FireFox 4. And call the script you wish to debug with additional parameter, e.g. http://test.my/project3/index.php?XDEBUG_SESSION_START=netbeans-xdebug

When you return to NetBeans you will see that connection with xdebug is established successfully. To stop XDebug session manually call any script from the same subdirectory with this parameter ?XDEBUG_SESSION_STOP_NO_EXEC=netbeans-xdebug

The complete solution can be found on my newest hero's blog NetBeans 7.0 for PHP Waiting for Connection to XDebug

Edit: Know what I just discovered? I removed index.php as the index file of my run configuration. Works like a charm without having to manually insert the xdebug section of the url.

Related Topic