いつかのために

自作サイトができるまで、メモ置き場として使っているブログ

Laravelのローカル開発環境を作成(1)

本番環境先に作るなよ!順番違うだろ!って感じですが、
公式ドキュメントオススメのLaravel開発環境を導入します。

Laravel Homestead 5.7 Laravel

Laravel Homestead(入植農地、「ホームステード」)はパッケージを事前に済ませた、Laravel公式の"box"で、PHPやWebサーバ、その他のサーバソフトウェアをローカルマシンにインストールする必要なく、素晴らしい開発環境を準備できます。オペレーティングシステムでごちゃごちゃになる心配はもうありません!

最高じゃないですか!
早速、コマンドプロンプトを起動して……
vagrant box add laravel/homestead

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054

……通信状況の問題か、何度やっても上記のエラーが起こりました。

検索すると
【Vagrant】SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054 · GitHub
インターネットの回線が弱いからとのこと。

また、別のサイトでは、
vagrantは前回のデータから引き続きデータをダウンロードしてくれるので、
何度もダウンロードを繰り返していれば、いつかは成功するよ!
という記述もあったのですが、私のPCでは一向に完了しそうにありませんでした。

qiita.com

今回はこちらのサイトを参考に、Git bushからコマンドを入力
vagrant box add laravel/homestead

==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://vagrantcloud.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) hyperv
2) parallels
3) virtualbox
4) vmware_desktop

Enter your choice: 

3

Enter your choice: 3
==> box: Adding box 'laravel/homestead' (v6.3.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/6.3.0/providers/virtualbox.box
==> box: Box download is resuming from prior download progress
    box: Download redirected to host: vagrantcloud-files-production.s3.amazonaws    box:
==> box: Successfully added box 'laravel/homestead' (v6.3.0) for 'virtualbox'!

成功しました!
box追加だけでてこずったので、今回は分割して投稿します。