0

Debugging PHP, NetBeans not working with xdebug v3

I'm using ubuntu 18

PHP7.4

Xdebug v3.1.2

php-v 
PHP 7.4.28 (cli) (built: Feb 17 2022 16:06:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
    with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans

My xdebug configuation is

/etc/php/7.4/mods-available/xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.profiler_enable=1

Every time I click run in the Netebeans, I get on this message "Waiting for connection"

Ahmad Halah
  • 81
  • 1
  • 5
  • You should note that next to the `mods-available` folder there's likely a `mods-enabled` folder, and if the `xdebug.ini` isn't symlinked over, then it's not enabled. – Sammitch Mar 18 '22 at 19:30
  • When I run `php -m` I see all the `extensions` in `mods-available` are enabled, this is the default configurations in `php7.4` – Ahmad Halah Mar 18 '22 at 20:06

1 Answers1

0

The default Port for xdebug V3 is 9003 and all the above the configurations are removed in xdebug v3

Replace

xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.profiler_enable=1

With

xdebug.log="/var/log/xdebug.log"
xdebug.idekey=netbeans-xdebug
xdebug.mode=debug
outbut_buffering=Off
Ahmad Halah
  • 81
  • 1
  • 5