端くれプログラマの備忘録 Laravel [Laravel] WindowsへのHomesteadのセットアップ (1)

[Laravel] WindowsへのHomesteadのセットアップ (1)

オンラインドキュメントを参照しながら、ローカルでのLaravelの開発環境を構築する。

Installation
http://laravel.com/docs/5.1

サーバー要件は以下の通り。

  • PHP >= 5.5.9
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension

開発環境としてLaravel HomesteadというVagrant boxが用意されているようなので、ドキュメントの手順に従ってセットアップしてみよう。

Laravel Homestead
http://laravel.com/docs/5.1/homestead

HomesteadはVagrant 1.7でビルドされて動作検証済み。以下のソフトが含まれているとのこと。

  • Ubuntu 14.04
  • PHP 5.6
  • HHVM
  • Nginx
  • MySQL
  • Postgres
  • Node (With PM2, Bower, Grunt, and Gulp)
  • Redis
  • Memcached
  • Beanstalkd
  • Laravel Envoy
  • Blackfire Profiler

念のため手元のマシンのVagrantのバージョンをチェック。バージョンは問題ない。

> vagrant version
Installed Version: 1.7.2
Latest Version: 1.7.4
>

Homestead Vagrant Boxのインストール

コマンドプロンプトから実行。

> vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://atlas.hashicorp.com/laravel/homestead
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) virtualbox
2) vmware_desktop

Enter your choice: 1
==> box: Adding box 'laravel/homestead' (v0.2.7) for provider: virtualbox
    box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versio
ns/0.2.7/providers/virtualbox.box
    box: Progress: 100% (Rate: 2690k/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'laravel/homestead' (v0.2.7) for 'virtualbox'!

>

Homesteadリポジトリのクローニング

シェルスクリプトを実行したいので、Git Bashから実行。

$ cd C:\Users\84kure
$ git clone https://github.com/laravel/homestead.git Homestead
Cloning into 'Homestead'...
remote: Counting objects: 1195, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 1195 (delta 0), reused 0 (delta 0), pack-reused 1190
Receiving objects: 100% (1195/1195), 183.34 KiB | 0 bytes/s, done.
Resolving deltas: 100% (706/706), done.
Checking connectivity... done.

$ cd Homestead
$ bash init.sh
Homestead initialized!
$

C:\Users\84kure\.homesteadにHomestead.yamlが作成される。

(次回へ続く)