首页 > 解决方案 > Laravel project wont serve to given ip via Homestead

问题描述

I am having trouble setting up my laravel project on my mac. I have (As far as I can tell) set up the homestead.yaml config correctly within my Homestead directory:

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Documents/GitHub/project-darwin
      to: /home/vagrant/code

sites:
    - map: homestead.test
      to: /home/vagrant/code/public
      php: "7.2"

databases:
    - homestead

After I have used vagrant up, on using vagrant ssh I can see my project inside of vagrant/code/project-darwin.

My hosts file is as follows:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

192.168.10.10   homestead.test

Which looks correct as is no different to what I normally do when running other laravel projects on virtualbox, however on going to my url, I get a 500 error and the same applies if I go directly to the ip (198.168.10.10).

A further thing I find suspicious is the following. When I use vagrant up, this is part of what shows in my terminal:

homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2222
    homestead-7: SSH username: vagrant

Should this ip be the same as the ip I supplied? Anyway, I have run out of ideas as to how to go about fixing this, any suggestions?

标签: laravelvagranthomestead

解决方案


所以事实证明我的mac已经自动选择了。当我运行时,hyperv 作为我的提供者vagrant box add laravel/homestead,哦,好吧..


推荐阅读