Install Netbeans Xdebug + PHP + ubuntu Operating System

Possible duplicate:
Xdebug and Netbeans do not interact with each other

How to implement xdebug in netbeans . I searched a lot and I did something in apache php.ini

 zend_extension=/path/to/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 

We use the Ubuntu OS.

xdebug is mainly used for debugging complex php code. ( for loop / foreach )

Right now, when I click on the debug project netbeans project, the footer showing the search for the xdebug connection and its end does not end means the connection failed.

I think you get what I want.

Please help me.

+4
source share
1 answer

I recently configured xdebug with netbeans in ubuntu .

Below are the following steps to install and configure xdebug using netbeans

1) Go to this page and install the Firefox plugin:

  https://addons.mozilla.org/en-US/firefox/addon/easy-xdebug/ 

2) Install xdebug using command from command line (terminal)

  sudo apt-get install php5-xdebug 

3), then open xdebug.ini from the terminal:

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

4) Copy only one line. (it should look like this:

 zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so). 

5) open the php.ini file with superuser privileges using this command

 sudo gedit /etc/php5/apache2/php.ini 

6) paste the line that you copied from xdebug.ini , as well as the following four lines into the php.ini :

paste the copied string here

  xdebug.remote_enable=On; xdebug.remote_host="localhost;" xdebug.remote_port=9000; xdebug.remote_handler="dbgp"; 

7) It is done !!! just need to restart apache:

use the following command to do this:

 sudo /etc/init.d/apache2 restart 

Now just open the project in netbeans and press ctrl+F5 or click debug>debug project from the menu.

Hope this helps you.

+13
source

All Articles