我遵循Laravel准则,并且已经启动并运行了Vagrant,但是当我访问“ http://homestead.test/”时,没有任何负载。
Homestead.yaml
--- ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/code
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/Laravel/public
databases:
- homestead
主机
# 127.0.0.1 localhost
# ::1 localhost
# 192.168.10.10 homestead.test
有人可以阐明我错过的事情吗?谢谢。
更新:尝试通过GitBash运行Homestead时出现以下错误:
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["modifyvm", "29535830-0e33-4f82-a359-6973606f6529", "--natpf1", "delete", "ssh"]
Stderr: VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 529 of file VBoxManageModifyVM.cpp
答案 0 :(得分:1)
您似乎不小心将hosts
条目注释掉了。
更改
# 127.0.0.1 localhost
# ::1 localhost
# 192.168.10.10 homestead.test
到
# 127.0.0.1 localhost
# ::1 localhost
192.168.10.10 homestead.test
答案 1 :(得分:0)
您应该具有以下内容:
---ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: c:/Users/UserName/.ssh/id_rsa.pub
keys:
- c:/Users/UserName/.ssh/id_rsa
folders:
- map: e:/MyFolder/Homestead
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/public
databases:
- homestead