vagrant box add laravel/homestead
由於在國內所以你懂得,不可能下載成功的。。。
參考解決 Homestead 國外映象無法下載問題
連結: https://pan.baidu.com/s/1kVR70CR 密碼: q4xy
下載解壓。。。
開啟 metadata.json
{
"name": "laravel/homestead",
"versions":
[
{
"version": "4.0.0",
"providers": [
{
"name": "virtualbox",
"url": "F\:laravelhomestead/virtualbox.box"
}
]
}
]
}
將url
修改成自己對應的地址
在git bash根目錄下https://github.com/laravel/homestead.git
下載完成後執行git checkout v6.5.0
選擇完版本之後再執行bash init.sh
執行完成後你就會看見
$ bash init.sh
Homestead initialized!
接下來我們配置一下Homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: D:/phpStudy/WWW 您的專案庫地址
to: /home/vagrant/code
sites:
- map: homestead.test 您的站點配置
to: /home/vagrant/code/Travel/public
databases:
- homestead
vagrant box add laravel/homestead your/box/path
注意your/box/path
填寫Windows系統相對路徑
$ vagrant box add laravel/homestead /f/laravelhomestead/metadata.json
==> box: Loading metadata for box 'F:/laravelhomestead/metadata.json'
box: URL: file:///F:/laravelhomestead/metadata.json
==> box: Adding box 'laravel/homestead' (v4.0.0) for provider: virtualbox
box: Downloading: F:laravelhomestead/virtualbox.box
box:
==> box: Successfully added box 'laravel/homestead' (v4.0.0) for 'virtualbox'!
看到Successfully
您已成功完成Homestead配置
vagrant up
在系統hosts中加入192.168.10.10 homestead.app
再您的瀏覽器執行homestead.app
盡情享用吧!O(∩_∩)O
本作品採用《CC 協議》,轉載必須註明作者和本文連結