I have a vagrant box running locally on my mac along with PHP 7.4 and xdebug. I can see xdebug loaded with:
vagrant@vagrant:~$ 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
...and /etc/php/7.4/mods-available/xdebug.ini has:
zend_extension = /usr/lib/php/20190902/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9000 #if you want to change the port you can change
My Sublime Text 3/Packages/User/Xdebug.sublime-settings has:
...
"host": "127.0.0.1",
// Which port number Sublime Text should listen
// to connect with debugger engine.
"port": 9000,
...
I tried forwarding port 9000 from vagrant to host and I get an error saying the port is already in use. I'm guessing that is because sublime is using it on the host side.