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 ? 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.