Install Xdebug In Ubuntu

in OS, Ubuntu / 3 Comments

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 http://en.wikipedia.org/wiki/Xdebug

List of commands

Command 1:

sudo apt-get install php5-xdebug

Command 2:

sudo find / -name ‘xdebug.so’

Outout

/usr/lib/php5/20090626/xdebug.so

Command 3:

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

Command 4:

There we have already :

zend_extension=/usr/lib/php5/20090626/xdebug.so

Add the below lines

xdebug.remote_enable=1

xdebug.remote_handler=dbgp

xdebug.remote_mode=req

xdebug.remote_host=127.0.0.1

xdebug.remote_port=9000

Command 5:

sudo /etc/init.d/apache2 restart

With more than 9 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]

Discussion 3 Comments

  1. Raghav

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

  2. Michael

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

  3. Harry

    sudo apt-get install php5-xdebug

    please update me if my php version is php7.0
    thanks

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>