I'm running MacOS Catalina. I installed php@8.0 and now i want to change default from php@7.4 to php@8.0.
I installed php@8.0 with this command:
brew install shivammathur/php/php@8.0
I tried to change the default php with this command:
brew link --overwrite --force php@8.0
It output this:
Warning: Already linked: /usr/local/Cellar/php/8.0.2
To relink:
brew unlink php && brew link php
Afterwards I restart Apache and Terminal but When I get the version of PHP with this command:
php -v
O get this output:
PHP 7.4.15 (cli) (built: Feb 4 2021 12:11:40) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies
Running in output on Terminal:
brew unlink php && brew link php
returns this output:
Unlinking /usr/local/Cellar/php/8.0.2... 24 symlinks removed.
Linking /usr/local/Cellar/php/8.0.2... 24 symlinks created.
After restarting Apache, I get this version of PHP:
PHP 7.4.15 (cli) (built: Feb 4 2021 12:11:40) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies