Homestead 环境搭建

环境:

  • win7 x64
  • powershell v2.0(查看版本 $PSVersionTable

搭建Homestead步骤

使用Virtualbox

1. 安装 Virtual Box

Virtual Box 官方下载

2. 安装 Vagrant

Vagrant 官方下载

使用VMware

待...

3. 在Vagrant中安装

运行下面命令

$ vagrant box add laravel/homestead

选择3
virtualbox

==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://vagrantcloud.com/laravel/homestead
This box can work...

1) hyperv
2) parallels
3) virtualbox
4) 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

切换到稳定版本,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
https://docs.microsoft.com/en...

等待初始化完成后,访问 http://homestead.test

启动后修改 homestead.yaml文件需要更新服务
$ vagrant reload --provision

停止服务

$ vagrant halt

参考


如果这对你有帮助,或者能帮你节省一些时间,不如,点个赞吧~

原文地址

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值