Configure Xdebug for debugging PHP on Ubuntu

sudo apt-get install php5-xdebug
find / -name 'xdebug.so'

Now update the options in PHP.INI – /etc/php5/apache2/php.ini

# Added for xdebug
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.max_nesting_level=300

Restart Apache2, and you are ready to go!

sudo service apache2 restart

References :
http://ubuntuforums.org/showthread.php?t=525257
http://wylbur.us/2014-06-17-add-xdebug-to-ubuntu-1404
http://purencool.com/installing-xdebug-on-ubuntu
https://www.jetbrains.com/phpstorm/help/configuring-xdebug.html