Instruction collected from multiple sources, there may be unnecessary steps, but that what worked with me after 4 days of stuggling :), so I'm recording it all
Install Xdebug 2.9.8
using pecl
sudo apt -y install php7.4-dev php-pear
pecl install xdebug-2.9.8
Create xdebug.ini file in mods-available
touch /etc/php/7.4/mods-available/xdebug.ini
zend_extension=/usr/lib/php/20190902/xdebug.so
# automatically start debugger on every request
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_port=9001
# send all debug requests to 127.0.0.1, remote_connect_back should be turned off
xdebug.remote_connect_back = 0
xdebug.remote_host=127.0.0.1
xdebug.remote_log=/var/log/xdebug.log
Add Xdebug to php.ini
in php cli ini file
/etc/php/7.4/cli/php.ini
[xdebug]
zend_extension=/usr/lib/php/20190902/xdebug.so
Make the symbolic link for xdebug.ini
ln -s /etc/php/7.4/mods-available/xdebug.ini /etc/php/7.4/fpm/conf.d/20-xdebug.ini
ln -s /etc/php/7.4/mods-available/xdebug.ini /etc/php/7.4/cli/conf.d/20-xdebug.ini
service nginx restart
service php7.4-fpm restart
Preferences > PHP > Debug
- Make sure that port is
9001
as in xdebug.ini file - Uncheck the option
Pass required configuration ...
in advanced settings - Connect using SSH Tunnel
ssh -R 9001:localhost:9001 [email protected]