Krishna
Krishna

Reputation: 1

NetBeans 11.3 waiting for connection to Xdebug

I am using Windows 10, NetBeans 11.3, PHP7.4.9, Apache/2.4.46 (Win64), XAMPP v3.2.4 and MySQL.

My php.ini file has the following settings:

output_buffering=off

[XDebug]

zend_extension = "c:\xampp\php\ext\php_xdebug-2.9.7-7.4-vc15-x86_64.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
xdebug.remote_enable = 1
xdebug.idekey="netbeans-xdebug"
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost:81"
xdebug.remote_log = "c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
xdebug.remote_cookie_expire_time = 36000

NetBeans configuration:

Debugger port: 9000
Session ID: netbeans-xdebug
Stop at first line: Checked
All other options are unchecked

When I click on debugging icon (Ctrl + F5) it gets stuck on "waiting for connection (netbeans-xdebug)" while shows the page completely without stopping at the break points.

Upvotes: 0

Views: 197

Answers (1)

Derick
Derick

Reputation: 36794

xdebug.remote_host = "localhost:81" is certainly not correct. The remote_host should have the value of the IP address or hostname where your IDE runs. This is likely just localhost.

You should also upgrade to Xdebug 3.1, which has much better logging functionality for troubleshooting connection errors through it's xdebug_info() function, and xdebug.log and xdebug.log_level settings.

Please do refer to the upgrade guide though, as some setting names have changed. You would likely only need:

zend_extension = "c:\xampp\php\ext\php_xdebug-3.1.3-7.4-vc15-x86_64.dll"
xdebug.mode=develop,debug       # replacement for xdebug.remote_enable
xdebug.start_with_request=1     # replacement for xdebug.remote_autostart
xdebug.idekey="netbeans-xdebug"
xdebug.client_port = 9000       # replacement for xdebug.remote_port
                                # I would recommend to use the default 9003,
                                # but you need to update Netbeans config to
                                # say the same too.

Upvotes: 1

Related Questions