0

I have a Linux virtual box, built using Vagrant. I am working on an application built using Symfony2 and wish to use PHP's built in server to host the application. I have got the PHP server running successfully using the command: php bin/console server:start. This tells me:

 [OK] Web server listening on http://127.0.0.1:8000

I've specified the following in the Vagrantfile:

config.vm.network "private_network", ip: "192.168.56.109

I want to access the application via the browser on my host machine which is running on Windows 7.

How can I achieve this?

2
  • do you have ping your vagrant ip on your host OS ?
    – miltone
    Commented Jan 21, 2016 at 17:57
  • what do you get on http://192.168.56.109:8000 ? Commented Jan 21, 2016 at 18:25

1 Answer 1

2

The default IP for the built-in web server is 127.0.0.1. In order for it to be visible outside your vagrant machine, you need to bind it to 0.0.0.0:

php bin/console server:start 0.0.0.0

Then you access http://192.168.56.109:8000 and it should work correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.