Check if xdebug is already installed: http://localhost:8080/phpinfo.php
Find the config file (ini file) on the above page then open it
<XDEBUG 2.X>
|
1 |
sudo gedit /etc/php/7.3/fpm/conf.d/20-xdebug.ini |
Make sure it’s enabled
|
1 2 3 |
zend_extension=xdebug.so xdebug.remote_enable = 1 xdebug.remote_autostart = 1 |
Then restart php7.3-fpm service
|
1 |
sudo service php7.3-fpm restart |
Check the xdebug properties on the page above: http://localhost:8080/phpinfo.php
Open VSCode then find and install ‘PHP Debug’ extension
</XDEBUG 2.X>
<XDEBUG 3.X>
|
1 |
sudo gedit /etc/php/7.2/apache2/conf.d/20-xdebug.ini |
ALSO FOR THE OTHERS PHP (7.4, 8.0, 8.1, 8.2)
|
1 2 3 4 |
sudo gedit /etc/php/7.4/apache2/conf.d/20-xdebug.ini sudo gedit /etc/php/8.0/apache2/conf.d/20-xdebug.ini sudo gedit /etc/php/8.1/apache2/conf.d/20-xdebug.ini sudo gedit /etc/php/8.2/apache2/conf.d/20-xdebug.ini |
Make sure it’s enabled
|
1 2 3 4 5 6 |
zend_extension=xdebug.so xdebug.mode= debug xdebug.start_with_request = yes xdebug.discover_client_host = true xdebug.max_nesting_level=512 xdebug.idekey = VSCODE |
Then restart apache2 service
|
1 |
sudo service apache2 restart |
Check the xdebug properties on the page above: http://localhost:8080/phpinfo.php
</XDEBUG 3.X>