13
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Homestead の PHPバージョンを変更する方法

Last updated at Posted at 2019-12-06

以下のように Homestead.yml にphpのバージョンを追記するだけ

Homestead.yml
sites:
    - map: homestead.test
      to: /home/vagrant/project1/public
      php: "7.3"

注意

これだけだとバージョンは上がっても、CLIのバージョンはデフォルトのままになってます。
php -v としても思っていたのと違うPHPのバージョンが表示される)

設定したバージョンに合致する以下のコマンドを実行して、CLIのバージョンも変更しましょう。

php56
php70
php71
php72
php73
php74

参考記事

https://laravel.com/docs/6.x/homestead#multiple-php-versions (公式ドキュメント)
https://takuyafujita.hatenablog.com/entry/2019/03/29/234813
https://www.84kure.com/blog/2019/09/03/laravel-homestead%E3%81%A7php%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B/

13
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?