PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 21, 2022

[FIXED] How to set up access to Symfony2 application via web browser?

 September 21, 2022     php, symfony, vagrant, virtualhost     No comments   

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing