Category Archives: NetBeans

XDebug NetBeans Apache configuration

So you want to debug your PHP website code with xdebug netbeans? In this post I will explain how to configure XDebug / Apache and NetBeans to start a debug session for your website.

First of all install the necessary components:

Restart the apache webservice and check for any errors:

Create a new website configuration in /etc/apache2/sites-available  :

Update your hosts file so you can easily test this new site .Add the following line to the file /etc/hosts :

Next enable remote debugging with XDebug. Although you just installed XDebug it will be disabled by default.

Create a script index.php  to see your changes to the apache / php configuration in the directory /var/www/xdebugger/www :

Navigate to http://www.xdebugger.tst

xdebugoff

As you can see in the picture above XDebug is not enabled. To enable the XDdebug feature add the following lines (if not already there) to the file /etc/php5/apache2/conf.d/20-xdebug.ini :

Now restart your apache service once more; execute the script and check the xdebug.remote_enable  setting:

Execute

Navigate to http://www.xdebugger.tst

xdebugon

 

Now goto your netbeans IDE and create a new project:

Set the main project to the newly created project:

Next start your first debugging session!

Additonal information about configuring NetBenas can be found here

Share