Reputation: 881
I'll try to be as detailed about the situation as possible but this has puzzled me for too long now.
I have an Ubuntu Server 12.04 guest running on a Win7 host. I configured the VBox with 2 NICs: a NAT adapter for communication to the outside world and a Host-Only adapter to create a private network for the host and guest to communicate in. The LAMP stack is the default stack provided with Ubuntu Server 12.04. The guest recognizes both NICs and the Host-Only NIC has a static IP configuration. The host is known as 192.168.56.1 and the guest is known as 192.168.56.101. I used this guide to set it up. ifconfig
shows both adapters. I tested if the host is reachable by pinging it and I do receive a reply.
I have everything working properly: MySQL, PHP, Apache2, APC, Shared folder mount and the project is reachable and loads as fast as it should.
This is where xdebug comes to play. As long as I disable the remote debugger OR tell xdebug my remote host is localhost, the project loads at a decent speed. But as soon as I tell xdebug that the remote host is anything else than localhost or that it should connect back to any request, the page load seems to hang for minutes before finally delivering the result.
I develop with Symfony2 which has a nifty developers toolbar and this toolbar actually tells me the pageload took 1174ms. This makes me suspect it's maybe xdebug and Apache not be playing nice. Also following is the very basic configuration I have attempted with xdebug:
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
;xdebug.remote_connect_back=on
xdebug.remote_host=192.168.56.1
xdebug.remote_port=9000
xdebug.remote_log = /var/log/xdebug.log
I'm completely clueless as to what might cause this problem and any help is much appreciated. Thanks in advance!
Upvotes: 3
Views: 2027
Reputation: 881
Alright it was not as complicated as I thought it was.
Windows Firewall was blocking the port. After I thought I had allowed port 9000 through the firewall I decided to check again by simply turning it off completely. Low and behold: it runs flawlessly. So I'll leave this reply here for people running into the same problem:
Make sure you allow traffic over your chosen debugger port when using a similar construction!
Upvotes: 4