Xdebug
From zen2
On Ubuntu it's easy, on XAMPP it's not too hard either.
For Ubuntu:
sudo apt-get install php-xdebug
Check phpinfo now has mention of xdebug.
Make sure your php mods-available folder contains xdebug.ini file and this file contains below line:
zend_extension=xdebug.so
Default xdebug location: /etc/php/7.0/mods-available/xdebug.ini
Now, add below lines at the bottom of your php.ini file:
[XDebug] xdebug.remote_enable=1 xdebug.remote_autostart=1
Finally restart apache.
sudo service apache2 restart
Add in the theeasiestxdebug firefox extension.
In VS Code add the PHP Debug extension, restart VS Code. In VS Code, open degug section, at the top change No Configurations to PHP. It should now say Listen for XDebug.
To start debugging, create a break point in the code, press start debugging in VS Code, press the footprints icon in firefox easiest debug. Do something in the browser.
https://medium.elegantly.rocks/enabling-php7-xdebug-for-vs-code-on-ubuntu-16-04-e13c5909119b
