Last Updated: August 09, 2019
·
1.444K
· oliverusselldev

Install Xdebug in PHP and Integrate with VsCode

To install xDebug on Linux Debian use following command:

sudo apt install php-xdebug;

Open etc/php/7.0/mods-available/xdebug.ini and add following

xdebug.profiler_enable_trigger = 1 xdebug.profiler_enable = 0 xdebug.remote_enable = 1 xdebug.profiler_output_dir = "/tmp"
Restart Apache

sudo service apache2 restart;

To integrate with VsCode use php debug extension.

Finally, run phpinfo(); method in any PHP file to check if Xdebug is enabled or not.

Source: PHP debug in VsCode and Xdebug