2

I'm using vagrant box hashicorp/precise64, Ubuntu 14.04, and PHP 5.6.

My Vagrantfile has config.vm.network "forwarded_port", guest: 80, host: 8080

I'm trying to test with the built in PHP server using: php -S localhost:80

The server is up in the virtual machine. I confirmed this with wget. However, I cannot access it from my host machine. My browser can't reach localhost.

Note: Apache and NodeJS servers both work, but not the built in PHP server.

Linny
  • 333
  • 1
  • 2
  • 10

1 Answers1

3

Solved.

https://stackoverflow.com/a/5999945/4736111

I had to use 0.0.0.0 for the address of the php server. Should have been php -S 0.0.0.0:80

Community
  • 1
  • 1
Linny
  • 333
  • 1
  • 2
  • 10
  • hey, what ? i'm using win8 and if i get into my vm php is working. The problem is if i try from my host wich is in windows. I go to whatever.dev and it shows all php tags! what are you suggesting to do with that 0.0.0.0 ? can you please explain me ? – Fo Nko Oct 31 '17 at 02:34