## 1、安装Homestead
#以下的操作在D盘
安装Composer,GIt Bash ,VirtualBox,Vagrant
我的Vagrant 安装目录选择在 D:/vagrant
#打开Git Bash 进入D: /Vagrant
cd D: cd Vagrant
vagrant box add laravel/homestead
#克隆 Laravel Homestead 仓库到 D:/homestead
cd .. git clone https://github.com/laravel/homestead.git cd homestead
Vagrantfile 表示 虚拟机开启时候会自动读取 ~/homestead/ 目录下相关配置文件、如果配置错误则会启动失败
#执行 init.sh
bash init.sh
cd ../wamp/www mkdir lvhome cd lvhome我装了wamp、所以我个人就创建在 D:/wamp/www 下、
#安装 laravel
composer create-project laravel/laravel Laravel --prefer-dist
ssh-keygen -t rsa -C "you@homestead"
打开 C:/Windows/System32/drivers/etc/host 添加
192.168.10.10 homestead.app
将
--- ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - map: ~/Code to: /home/vagrant/Code sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public databases: - homestead variables: - key: APP_ENV value: local # blackfire: # - id: foo # token: bar # client-id: foo # client-token: bar # ports: # - send: 93000 # to: 9300 # - send: 7777 # to: 777 # protocol: udp
--- ip: "192.168.10.10" memory: 2048 cpus: 2 provider: virtualbox authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - map: D:/wamp/www/lvhome to: /home/vagrant/Code sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public databases: - homestead variables: - key: APP_ENV value: localFolders 是本地与虚拟机的目录映射、即 本地的D:/wamp/www/lvhome 与虚拟机的 Code 是同步的、修改任何一方、双方都改变
Sites 是域名访问的目录、上面hosts 文件配置 homestead.app 会直接访问Code/Laravel/public 目录,也是 wamp/www/lvhome/Laravel/public 目录
#启动虚拟机
cd d:/homestead vagrant up
#访问 http://homestead.app:8000 即安装完成
##2、相关操作
#进入 虚拟机
vagrant ssh我设置ssh 时候密码为空
ls cd Code ls exit
#设置别名
alias vm="ssh [email protected] -p 2222" vm
php -v
mysql -uhomestead -p密码为 secret
show databases; exit;
## 3、安装homestead 2.0
#安装homestead (同1)
vagrant box add laravel/homestead
# 安装依赖
composer global require "laravel/homestead=~2.0"
#加入homestead 到环境变量中的path 后面
C:\Users\hello\AppData\Roaming\Composer\vendor\bin
#初始化 ./homestead目录 (同bash init)
homestead init
#打开配置文件
homestead edit
folders: - map: D:/wamp/www/lvhome to: /home/vagrant/Code sites: - map: homestead.app to: /home/vagrant/Code/typicms/public
#配置 SSH
ssh-keygen -t rsa -C "you@homestead"
其他步骤类似以上安装homestead 1.0
vagrant 命令改成 homestead
#启动
homestead up
homestead -help
## 4安装 typicms
#进入虚拟机
ssh [email protected] -p 2222
#克隆源码
cd Code composer create-project sdebacker/typicms typicms过程中需要填用户用和密码产生token
#创建数据库
mysql -uhomestead -p密码:secret
create database typicms; show database; exit;
#安装
cd typicms sudo php artisan typicms:install使用sudo 安装
提示执行 bower install 和 gulp 失败、不过也能运行!
## 4、安装phphub (安装出错!待解决)
#克隆源码
cd Code git clone https://github.com/summerblue/phphub
#安装依赖包
cd phphub compser install --prefer-dist--prefer-dist 加速下载速度、安装过程中提示输入账户和密码创建token
#创建数据库
mysql -uhomestead -p密码:secret
create database phphub; show database; exit;
cp env.example.php .env.local.php nano .env.local.phpctrl + x 退出
#安装依赖包
composer install --prefer-dist
php artisan migrate --seed
#codeception 与 BDD
#创建测试配置文件
cp .env.local.php .env.testing.php
#查看codecept用法
vendor/bin/codecept
vendor/bin/codecept run
http://blog.csdn.net/sangjeedondrub/article/details/45397435
http://vegibit.com/install-laravel-homestead-on-windows/
http://www.easylaravelbook.com/blog/2015/01/08/installing-and-configuring-homestead-2-dot-0-for-laravel-5/
http://blog.wu-boy.com/2014/09/get-homestead-vagrant-vm-running/
https://github.com/summerblue/phphub/wiki/PHPhub-%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E9%83%A8%E7%BD%B2
http://laravel-china.org/docs/5.0/homestead