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

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

以下のように 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/

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
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