Install Xdebug In Ubuntu

Hi friends, here I would like to explain how to install Xdebug in ubuntu 12.04 . By following list of commands we will installing Xdebug.

What is Xdebug:

Xdebug is a PHP extension which provides debugging and profiling capabilities. It uses the DBGp debugging protocol.

The debug information that Xdebug can provide includes the following:

  • stack and function traces in error messages with:
    • full parameter display for user defined functions
    • function name, file name and line indications
    • support for member functions
  • memory allocation
  • protection for infinite recursions
x-debug-installation-in-ubuntu by Anil Labs

Xdebug also provides:

  • profiling information for PHP scripts
  • code coverage analysis
  • capabilities to debug your scripts interactively with a debugger front-end.

Above text about Xdebug by

List of commands

Command 1:

sudo apt-get install php5-xdebug

Command 2:

sudo find / -name ‘’



Command 3:

sudo gedit /etc/php5/cli/conf.d/xdebug.ini

Command 4:

There we have already :


Add the below lines






Command 5:

sudo /etc/init.d/apache2 restart

Anil Kumar Panigrahi

With more than 10 years experience in PHP and Founder of Anil Labs, a blog for PHP and related posts. contributed posts regarding CodeIgniter, CakePHP and Learn PHP online ... Contact : [email protected]

You may also like...

3 Responses

  1. Raghav says:

    awesome ends with your blog i really like the way you explain things in a very simple way thanks for the share 😉

  2. Michael says:

    Shouldn’t we edit the file in /etc/php5/mods-available/xdebug.ini instead of the one in the cli directory?

  3. Harry says:

    sudo apt-get install php5-xdebug

    please update me if my php version is php7.0

Leave a Reply

Your email address will not be published. Required fields are marked *