NetBeans + XDebug Breakpoints not working

2.4k views Asked by At

I know there are countless of questions regarding this subject, however no matter what I've tried I've had no luck whatsoever. The problem I'm encountering is regarding breakpoints when using NetBeans and XDebug (on Windows 8.1 if that affects anything).

The issue is that no breakpoints are working. By default when debugging with NetBeans, it stops on the first line and this does successfully happen. Therefore NetBeans is somehow connecting to XDebug. However, any other breakpoints in any other files are not working.

I've tried various different settings in the php.ini file but no luck so far. I've also tried switching on the XDebug log file so that maybe I can analyse what's going on, but this also didn't work. Finally I've tried setting breakpoints using xdebug_break() which also didn't work.

XDebug settings in php.ini

;[XDebug]
; Only Zend OR (!) XDebug
zend_extension="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\xampp\tmp"

Project Run Configuration on NetBeans

Project Run Configuration

Advanced Configuration

I've already looked at the following:

Also note that this was working 3 days ago, however today no breakpoints are working.

Additional Info

I've run the following command in cmd php -v and the following warning was shown:

Warning: Module 'xdebug' already loaded in Unknown on line 0

Does this mean that xdebug is trying to be loaded twice? If so I'm not sure how this can be solved

1

There are 1 answers

2
Daniel Grima On

Figured out what the problem was. I know that this answer will be very specific, however it might help someone in the future.

So while inspecting the code I noticed that someone added code that cleared all cookies when the login page loaded. Once the cookies are removed XDebug didn't work. The reason is that for XDebug to work it sets a cookie with the session id for example 'netbeans-xdebug' which is sent with every request on the website.

It's a very simple issue but it took nearly 2 days to find out what was going on. Once again I know that this is a very specific case but maybe it might help someone out there.

Happy coding!