- 参考: https://laravel.com/docs/5.6/homestead;
- 使用Homestead省事,集成了各种需要的包;
- 前提:安装好vagrant和需要的虚拟机
- 安装Homestead Vagrant Box
vagrant box add laravel/homestead
- 安装Homestead
git clone https://github.com/laravel/homestead.git ~/Homestead
- 选择需要的版本
cd ~/Homestead
git checkout v7.8.0
- 生成配置文件
Homestead.yaml
mac/linux:bash init.sh
win:init.bat
- 修改配置文件
provider: virtualbox #虚拟机 folders: #同步文件 - map: ~/code/project1 to: /home/vagrant/code/project1 type: "rsync" options: rsync__args: ["--verbose", "--archive", "--delete", "-zz"] rsync__exclude: ["node_modules"] - map: ~/code/project2 to: /home/vagrant/code/project2 sites: #配置访问的域名 - map: homestead.test to: /home/vagrant/code/Laravel/public
- 修改hosts文件,和配置文件中地址,名称一致
- 其余的后续遇到了再补充
网友评论