Web Projects Outsourcing

Xdebug in Netbeans for a VirtualBox Guest Host

Setting up the working xdebug on a virtual guest is the same as setting up the debug for the remote server.

Our setup is the following:

  1. Fedora desktop running a VirtualBox instance
  2. Fedora virtual guest on the same desktop running via the a virtual bridge
  3. Netbeans php project on desktop

First of all, make sure the xdebug is installed:

Configure the ini file:

[text]
zend_extension=/usr/lib/php/modules/xdebug.so
xdebug.remote_enable = on
xdebug.remote_autostart = on
xdebug.remote_handler = dbgp
xdebug.remote_port = 9000

The address of the current virtual guest on the network

xdebug.remote_server = [GUEST_NETWORK_ADDRESS]
xdebug.remote_mode = req
output_buffering = off
xdebug.remote_log = "/var/log/xdebug.log"

Must be same as in Netbeans configuration

xdebug.idekey = "netbeans-xdebug"
[/text]

Restart Apache server on guest in case of fixes made.

Check the Netbeans configuration to match the above

Netbeans config for php xdebug

Netbeans config for php xdebug

We will need a tunnel for the whole thing to work. Open a new terminal on your desktop and run the following:

Check it another terminal window on desktop, the output should look like the below:

Now the xdebug should become to be available in Netbeans like the below:

xdebug working in Netbeans on virtual guest

xdebug working in Netbeans on virtual guest

Leave a Reply

Your email address will not be published. Required fields are marked *

seventeen + 12 =