Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vagrant homestead can't access host(laravel 5.2)

When I goto my host ao.dev:8000 or ao.dev, "this site can't be reached,ao.dev refused to connect" is displayed.

My yaml file:

enter image description here

also i've my view file:

i've checked:

enter image description here

I've run vagrant up command by going to Homestead directory .

Also see: https://stackoverflow.com/questions/38801375/vagrant-up-not-forwarding-all-portshomesteadlaravel-5-2windows-10

like image 679
YaSh Chaudhary Avatar asked Aug 02 '16 16:08

YaSh Chaudhary


2 Answers

Actually I was using WAMP before installing homestead. So I uninstalled both i.e. wamp and homestead setup including vagrant and virtual box. Then I installed homestead setup again and it worked. I dont know the logic behind but maybe wamp and homestead were conflicting. It worked so I posted the answer.

like image 95
YaSh Chaudhary Avatar answered Sep 20 '22 15:09

YaSh Chaudhary


What I needed to do to get my local Laravel up and running:

  • use 127.0.0.1 rather than 192.168.10.10 in my hosts file
  • make sure the .env file had the correct hostname listed as the APP_URL
  • make sure to use the :8000 port to access the site

Additionally:

  • if you're adding multiple sites, make sure to run vagrant provision after adding each site to your Homestead.yaml
  • not sure if it makes a difference, but you might want to put a space after the colon for the map command, i.e. map: ao.dev
  • I did not need to add hostname or name elements to Homestead.yaml
like image 43
Leith Avatar answered Sep 23 '22 15:09

Leith