4

Possible Duplicate:
Xdebug and Netbeans are not communicating with each other

How to implement xdebug in netbeans. I searched lot and I have done some stuff 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

Am using Ubuntu OS.

Xdebug is mainly using for debug complex php code.( for loop / foreach)

Right now when I click on debug project netbeans footer status showing searching for xdebug connection and its not ending not ending means connection failed.

I think you get what I want.

Please help me.

Community
  • 1
  • 1
george
  • 201
  • 1
  • 3
  • 6
  • When you start debugging from netbeans does a browser window open with the project you are working on? – Eelke Dec 29 '12 at 07:04

1 Answers1

13

Recently I have configured xdebug with netbeans in ubuntu.

Here are the following steps for you to installing and configuring xdebug with 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 below from command prompt(terminal)

   sudo apt-get install php5-xdebug

3) then open xdebug.ini from terminal:

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

4) Copy the only line there. (which should be look like:

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

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

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

6) paste the line you copied from the xdebug.ini along with the following four lines into your php.ini file:

paste the copied line here

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

7) It's done!!! just need to restart your apache:

use following command for that:

sudo /etc/init.d/apache2 restart

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

Hope it will help you.

J.K.A.
  • 7,272
  • 25
  • 94
  • 163