PHPSTORM and Virtualbox

I am trying to get PHPSTORM to work with a VirtualBox when PHPSTORM is running on my host Windows machine and Apache, PHP and XDebug are running in a VirtualBox.  What I'm finding is that although the browser will display the results of the php file that is in the VirtualBox, it will NOT stop at breakpoints that I have inserted with into that file.  I've been at this for two days now, trying virtually every combination of settings that I can find, all to no avail.  Some relevant items:

  • Yes, PHPSTORM is listening, and YES I have used the Firefox extension to start XDebug.  I've also just put in the idekey directly into the URL that I use to display the page.
  • I am using the Host Only adapter in my Virtualbox,and my Windows Host machine does see that adapter.
  • XDebug settings are as follows
        xdebug.remote_autostart = 1 [I've also tried 0]
        xdebug.remote_port=10000 [I've also tried 9000, and PHPSTORM is correctly configured to listen to the port set in XDebug
        xdebug.remote_host=localhost [I've also tried the URI of the Virtualbox server]

There are, of course, MANY settings available within PHPSTORM, but including all of them would make this post way too long.  I'll of course be happy to respond to any questions with specific information.

Suggestions would be gratefully received, but also if anybody has an idea of where I could get somebody to help that would be useful also.



Comment actions Permalink

I finally figured this out.  xdebug.remote_log told me that XDebug was unable to get in touch with PHPStorm,so the question became "How does an application running on a VirtualBox talk to one that is running on the Windows Host".  I found somewhere else that you can find the IP address of the host machine as viewed by Ubuntu in VirtualBox by examining the properties of the [created in VirtualBox] Network Connectors on the Windows Machine.  You do this by going to ControlPanel->Network and Internet->Network Connections on the Windows Host machine.  There I found that the IP address of the Host machine was and once I set that in my php.ini file everything worked just fine.  

Comment actions Permalink

Thanks for sharing the solution, good to know that things are working fine for you now!


Please sign in to leave a comment.