【笔记】Homestead环境安装

前言

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!(官方文档

准备工作

VirtualBox

  • 确保安装最新的VirtualBox
1
brew cask install virtualbox

vagrant

  • 确保安装最新的vagrant
1
brew cask install vagrant

安装

下载项目

1
git clone https://github.com/laravel/homestead.git

进入项目根目录

1
cd homestead

初始化项目

1
bash init.sh

配置

1
vim Homestead.yaml

启动虚拟机

  • 首次启动较慢
1
vagrant up

ssh远程连接虚拟机

1
vagrant ssh

安装laravel开发环境

  • 以普通用户身份安装
1
composer create-project laravel/laravel Laravel --prefer-dist

完成

参考文献

CSDN——东方宏
简书——塞外务农