After a bitter almost 24-hour run trying to get xdebug to work with Netbeans 8.0.2, I found a solution that I hope will work for all Ubuntu and Ubuntu-related stacks.
Problem number 1: PHP and xdebug versions must be compatible
Sometimes, if you use Linux installation and apt-get to install xdebug, it will not give you the correct version of xdebug. In my case, I had the latest version of php, but the old version is xdebug. This should be related to my current version of Xubuntu. The software version depends on the repositories, which depend on the OS version that you are using.
PHP has a neat extension manager called PECL. Follow the instructions here to launch it. First, as a member noted in the comments, you must install the PHP developer package to get PECL to work:
sudo apt-get install php5-dev
Then, using PECL, you can install the latest stable version of xdebug:
sudo pecl install php5-xdebug
Once you do this, the correct version of xdebug will be installed, but not ready for use. After that you need to enable it. I have seen many suggestions on how to do this, but the fact is that PHP needs some modules that will be included both for the client and the server, in this case Apache. It seems that the best way is to use the built-in module inclusion method called php5enmod. Use is described here .
Problem number 2: enable the module correctly
First you need to enter the / etc / php 5 folder. There you will find 3 folders, apache2, cli and mods_available. The mods_available folder contains text files with instructions for activating this module. The naming convention is [module] .ini. Look at a few of them, see how they are configured.
Now you need to create your ini file inside the mods_available folder. Create a file called xdebug.ini and inside the file, paste this:
[xdebug] zend_extension = /usr/lib/php5/20121212/xdebug.so xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=localhost xdebug.remote_port=9000
Make sure that the [xdebug] directive exists, as in the example above. Be sure the module works. In fact, just copy and paste the whole code, you will become a happier person .: D
Note: the zend_extension path is very important. In this example, this points to the current version of the PHP engine, but first you have to go to / usr / lib / php 5 and make sure that the folder with the name with the numbers is correct. Set the name to what you see there, and while you are on it, check inside the folder to make sure xdebug.so is really there. This should be if you did everything right.
Now that your xdebug.ini has been created, it's time to turn on the module. To do this, open the console and enter:
php5enmod xdebug
If everything went right, PHP created two links to this file: one inside / etc / php 5 / apache2 / conf.d and the other inside / etc / php 5 / cli / conf.d
Restart the Apache server and enter it into the console:
php -v
You should get something like this:
PHP 5.5.9-1ubuntu4.6 (cli) (built: Feb 13 2015 19:17:11) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies with Xdebug v2.3.1, Copyright (c) 2002-2015, by Derick Rethans
This means that the PHP client read your xdebug.ini file and loaded the xdebug.so module. So far so good.
Now create a phpinfo script somewhere on your web server and run it. This is what you should see if everything goes against:

If you see this, Apache also loaded the module, and you are probably ready to go. Now let's see if Netbeans is debugging properly. Create a very simple script, add some variables, give them values and set a breakpoint for them. Now press CTRL + F5, click "step in" in the debugger panel and see if you have something like this:

Remember to check the Netbeans configuration for debugging under tools / options / php. It should look something like this:

I hope this sheds some light on this rather obscure, confusing problem.
Regards!