resources:
https://jtreminio.com/2012/07/xdebug-and-you-why-you-should-be-using-a-real-debugger/
https://github.com/joonty/vdebug
http://xdebug.org/download.php
Download the latest stable release of xdebug.
$ tar -xzf xdebug-file-you-downloaded
$ cd xdebug-2.2.2
$ phpize
$ ./configure --enable-xdebug
$ make
$ sudo make install
We’re looking for xdebug.so module and it should have been dropped into xdebug/modules after it compiles.
I moved mine into the following path: /usr/lib/php5/20090626/xdebug.so
Take heed on the above location as I initially installed xdebug from the ubuntu repos but it was not the latest version so i then decided to compile from source. I did a find on existing xdebug location which was the path shown above. I then replaced the old version with the newly compiled version.
Update php.ini:
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.remote_autostart = On
xdebug.remote_enable = On
xdebug.remote_host = localhost
xdebug.remote_port = 9000
restart apache
Use phpinfo() and check if xdebug modules are appearing.
Install vdebug for vim. Once this is done be sure your help tags are updated and run :help Vdebug . I read over this and it does a great job of helping setup your environment. The following is taken from the help file.
Setup a script that sits in your path to help debug:
#!/bin/bash
export XDEBUG_CONFIG="idekey=xdebug"
/usr/bin/php "$@"
Make the above executable and put it in your path somewhere. I called mine php-xdebug.