简体   繁体   中英

NetBeans + XDebug Breakpoints not working

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

项目运行配置

高级配置

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM