Fix error xdebug ver 3.0.1 not working on ubuntu

Tram Ho

When working with php code, we often use xdebug to debug code, but on a beautiful day, suddenly after a series of system updates we can no longer use xdebug, which makes the work less efficient. when using var_dum () or echo to debug. After searching for a lot of time, it was discovered that version 3.0.1 has changed the port instead of using port 9000 now using port 9003. It seems to have been fixed, but without life, xdebug is still not working, so we need to reconfigure a little more.

First we change the php.ini file here, we use apache2 and php 7.2 so we will run the following command: sudo gedit /etc/php/7.2/fpm/php.ini coppy the following config line into the php.ini file [xdebug]

Next, go to the xdebug.ini file to edit sudo gedit /etc/php/7.2/mods-available/xdebug.ini add the following line to the file

After editing the ini file, we fix the port in the json file

Finally restart apache2 to enjoy the results:

Check activity https: // yoursite /? XDEBUG_SESSION_START = 1

Share the news now

Source : Viblo