MacOS : Php8.0のインストール

広告:超オススメUnity Asset
  広告:超オススメUnity Asset

composer update時にphp8が必要とのことでエラーが発生したのでMEMO。

brew search php@7
==> Formulae
php@7.2             php@7.3             php@7.4            php
php -v
PHP 7.4.25 (cli) (built: Oct 23 2021 18:05:05) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.25, Copyright (c), by Zend Technologies

brew install php@8.0
vi ~/.zshrc

viで書き込み。iescキー

export PATH="/usr/local/opt/php@8.0/bin:$PATH"
export PATH="/usr/local/opt/php@8.0/sbin:$PATH"

保存:wq!。反映してバージョン確認。

source ~/.zshrc
php -v 
PHP 8.0.13 (cli) (built: Nov 19 2021 09:04:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies

あとは、

composer update

 

以上