Help us understand the problem. What is going on with this article?

使いたいPHPバージョンに合わせて Laravel Homestead を選ぼう

More than 3 years have passed since last update.

Laravel Homestead の第3の使い方で紹介した方法を使うと、Homestead のバージョンによってインストールされるPHPのバージョンも切り替えることができます。

homestead Ubuntu PHP MySQL
2.2.2 14.04.3 LTS PHP 5.6.13-1 mysql Ver 14.14 Distrib 5.6.19
3.1.0 16.04.1 LTS PHP 7.0.13-1 mysql Ver 14.14 Distrib 5.7.16
4.0.3 16.04.1 LTS PHP 7.1.0-2 mysql Ver 14.14 Distrib 5.7.16

PHP 5.6

composer.json
{
    "require-dev": {
        "laravel/homestead": "^2.0"
    }
}
$ php -v
PHP 5.6.13-1+deb.sury.org~trusty+3 (cli)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans
    with blackfire v1.4.1, https://blackfire.io/, by SensioLabs

PHP7.0

composer.json
{
    "require-dev": {
        "laravel/homestead": "^3.0"
    }
}
homestead.yaml
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: homestead
name: homestead
provider: virtualbox
version: 0.6.0  # boxバージョン指定が必要
$ php -v
PHP 7.0.13-1+deb.sury.org~xenial+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.13-1+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies
    with blackfire v1.14.1~linux-x64-non_zts70, https://blackfire.io, by Blackfireio Inc.

PHP7.1

composer.json
{
    "require-dev": {
        "laravel/homestead": "^4.0"
    }
}
$ php -v
PHP 7.1.0-2+deb.sury.org~xenial+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.1.0-2+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies
    with blackfire v1.14.1~linux-x64-non_zts71, https://blackfire.io, by Blackfireio Inc.
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした