环境:
- win7 x64
- powershell v2.0(查看版本
$PSVersionTable
)
搭建Homestead步骤
使用Virtualbox
1. 安装 Virtual Box
2. 安装 Vagrant
使用VMware
待...
3. 在Vagrant中安装
运行下面命令
$ vagrant box add laravel/homestead
选择3
virtualbox==> box: Loading metadata for box 'laravel/homestead' box: URL: https://vagrantcloud.com/laravel/homesteadThis box can work...1) hyperv2) parallels3) virtualbox4) vmware_desktop$ Enter your choice: 3 # step 2
下载速度慢,可换其他下载器下载下载好后,运行命令进行安装
$ vagrant box add laravel/homestead /path/to/virtualbox.box
4. 安装Homestead
$ git clone https://github.com/laravel/homestead.git Homestead$ cd Homested
切换到稳定版本,
$ git checkout v7.1.2$ init.bat
5. 初始化Homestead
修改文件homestead.yaml
folders: - map: ~/code # 替换为项目路径
6. 修改hosts
C:WindowsSystem32driversetchosts
追加如下内容
192.168.10.10 homestead.test
7. 启动Homestead
$ vagrant up
出现如下错误 The version of powershell currently installed on this host is less than the required minimum version. Please upgrade the installed version of powershell to the minimum required version and run the command again.需要更新powershell至5.x
等待初始化完成后,访问
启动后修改 homestead.yaml
文件需要更新服务
$ vagrant reload --provision
停止服务
$ vagrant halt
参考
如果这对你有帮助,或者能帮你节省一些时间,不如,点个赞吧~