Installation instructions XDebug – The Easy Way

I don’t know about you, but I always struggle to install Xdebug, whether it being Windows or Linux.

The XDebug installation wizard is here

Ubuntu Linux

sudo apt-get install php-xdebug

Edit php.ini (probably in /etc/php/[8.3]/apache2)

sudo nano /etc/php/8.3/apache2/php.ini

Add some lines at the bottom:

[XDebug]
xdebug.mode=debug
xdebug.start_with_request=yes

Reboot webserver

sudo service apache2 restart

Check for the existence of XDebug in the phpinfo().
When you run the installer (http://localhost/install/phpinfo.php) there is a phpinfo script for your convenience.

In phpinfo: check if step debugger is enabled:

Step Debugger: ✔ enabled

Don’t forget to install the PHP Debug plugin in VSCode / VSCodium!

Windows

Watch this video

https://www.youtube.com/watch?v=HrQWtbxY1Hs