Manually install xDebug with your PHP installation in UBUNTU/LINUX

Now let’s assume that you haven’t installed xDebug yet! Now we have to install xDebug. Now to do that first we have to install PHP PEAR. To install PEAR let’s type the following command.

sudo apt-get install php5-dev php-pear

Now if it says that you have already the latest PHP Pear. Then ready to move forward. Now to install xDebug you have to write down the following command.

sudo pecl install xdebug

After successfully installing xDebug. You have to add the following code in your php.ini file.

[xdebug]
; xDebug Configuration
extension=xdebug.so

After writing save php.ini and restart Apache. Yahooooooooo!!!!!!! Now you are getting colorful debug information of your program in PHP.

If you are using PHP installed by XAMPP on your Linux PC then just write the following command for installing xdebug.

sudo /opt/lampp/bin/pecl update-channels
sudo /opt/lampp/bin/pecl install xdebug

It’s for just installing xdebug on your /opt/lampp directory

Now you are done!! You can try to check it by using var_dump inside your code. happy coding!!

Shaharia is a professional software engineer with more than 10 years of experience in the relevant fields. Digital ad certified, cloud platform architect, Big data enthusiasts, tech early adopters.