0

I'm trying to run a simple Laravel project inside a Vagrant (VirtualBox) VM. The guest is Ubuntu 14.04 x64, and the host is Windows 7 x64. I've set up port forwarding (8000 on host to 8000 on guest), but when I run php artisan serve, though I get a message stating that the server is running on port 8000, when I visit localhost:8000 on my host machine, Chrome tells me 'this webpage is not available'. There are two complications:

First, if I use curl from inside the VM, I receive the correct page contents - so it appears the server is working fine.

Second, if I run a Python web server using python -m SimpleHTTPServer on the same VM, I can access it fine on my host OS. Visiting localhost:8000, I see the directory contents listed. So it appears the port forwarding is working fine.

I tried deleting the public/.htaccess file in the Laravel project, to no avail. I'm no PHP expert, and this problem is hard to Google! Any pointers would be appreciated.

2
  • Have you tried using Laravel Homestead? I find it's a much easier workflow when developing projects (not just Laravel). Commented Jan 21, 2015 at 9:04
  • The owner of the project hasn't been using it, so I tried to follow the steps they documented to set up the project locally. I've run across Homestead a lot, so I might end up having to go with it. Thanks! Commented Jan 22, 2015 at 1:17

1 Answer 1

7

After reading this question I tried

php artisan serve --host 0.0.0.0

And it works fine now.

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

1 Comment

It didn't work for me still showing This site can’t be reached 0.0.0.0 unexpectedly closed the connection.

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.