How to setup xdebug with Netbeans on Unbuntu

xdebug is a PHP extension for debugging of php code. It supports stack and function traces, profiling information and memory allocation and script execution analysis. It uses the DBGp debugging protocol.  In this post we are going to see easy steps to install and setup it with Netbeans IDE on Ubuntu

Step 1:

Install xdebug using following command

 

Step 2:

Browse to your php folder and locate xdebug.so file. In my case it is /usr/lib/php5/20121212/xdebug.so. Copy this files path.

Step 3:

Open your php.ini ( /etc/php5/apache2/php.ini ) and add following lines at the end of this file

Replace zend_extension path with the path you have copied in previous step

Step 4:

Restart your apache server using

Step 5:

Open Neatbeans and goto Tools > Options > PHP > Debugging and make sure that there is Debug Port set to 9000
and Session ID to “netbeans-xdebug

Step 6:

Thats it you are almost done. Now just create a new php project, add some breakpoints to any php file in it and click on Debug Project from tool bar or press ctrl+F5. This will start debugger.

 

Debugging Magento Project using xdebug with Netbeans on Ubuntu

Leave a Reply