NetBeans + XDebug breakpoints not working

I know that there are many questions on this, however, no matter what I tried, I was out of luck. The problem I'm encountering concerns breakpoints when using NetBeans and XDebug (on Windows 8.1, if that affects anything).

The problem is that no breakpoints work. By default, when debugging using NetBeans, it stops on the first line, and this succeeds. Therefore, NetBeans somehow connects to XDebug. However, any other breakpoints in any other files do not work.

I tried various settings in php.ini file, but no luck so far. I also tried to include the XDebug log file so that maybe I could analyze what was going on, but that didn't work either. Finally, I 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 Startup Configuration on NetBeans

Project run configuration

Advanced configuration

I have already considered the following:

Also note that this worked 3 days ago, however today no breakpoint is working.

Additional Information

I ran 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 download twice? If so, I'm not sure how this can be solved.

+6
source share
1 answer

Found out what the problem is. I know this answer will be very specific, however it may help someone in the future.

Therefore, while checking the code, I noticed that someone added a code that cleared all cookies when loading the login page. After deleting cookies, XDebug does not work. The reason is that for XDebug to work, it sets a cookie with a session identifier, for example, "netbeans-xdebug", which is sent with every request on the website.

This is a very simple problem, but it took almost 2 days to figure out what was going on. Once again, I know this is a very specific case, but maybe it can help someone out there.

Happy coding!

+2
source

Source: https://habr.com/ru/post/989532/


All Articles