Sometimes I have to work on our old projects written in PHP. Recently, I am using VS code as my php IDE. VS code has some great features. I can debug my code easily with XDebug and php-debug VS code extension. But, after upgrading my OS to Ubuntu 16.04, I was facing trouble installing xdebug. Most of the google search refers to php5 XDebug. But, in Ubuntu 16.04 default php version is php7.
So, after searching for a while, I found the solution is pretty simple. Install php-xdebug.
sudo apt-get install php-xdebug
Run below command in terminal to ensure xdebug is installed properly. You’ll find xdebug in the list.
Make sure your php mods-available folder contains xdebug.ini file and this file contains below line:
** Default xdebug location:
Now, add below lines at the bottom of your
Finally restart apache.
sudo service apache2 restart
And start php-debugging from VS-code.