Issue
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?
Solution
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.
Answered By - Nemanja Miljković Answer Checked By - Robin (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.