LoginSignup
0
0

More than 1 year has passed since last update.

PHPバージョン8→7.4

Last updated at Posted at 2021-05-13

プロジェクトの都合でダウングレードしました。

現在のバージョンを調べる

コンソール
php -v

バージョンが8になってました。

インストール済みの PHP バージョンを確認

コンソール
brew search php

HomebrewでインストールできるPHP7系を検索

コンソール
brew search php@7

7.4がインストールされてなかったのでインストールしました。

コンソール
brew install php@7.4

PHPのPATHを通す

コンソール
echo 'export PATH="/usr/local/opt/php@7.4/bin:$PATH"'>>~/.zshrc

MacOSによってbashかzshか違うみたいなので、Bashの人は .bashrcとか触ってください。

phpを起動

コンソール
brew services start php

ここで一回ターミナルを閉じて、再度起動

コンソール
php -v

PHP7.4になった!


参考にしました

https://mykii.blog/what-is-shell-bash-and-zsh/
https://qiita.com/takutoki/items/021b804b9957fe65e093

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