Added PHP8.0 with Homebrew. I’m using the shivammathur/homebrew-php tap as recommended in Brent’s post.
Steps
- brew tap shivammathur/php
- brew install shivammathur/php/php@8.0
That seemed to immediately link it. CLI reported 8.0 after that ran. - Nginx automatically used it via php-fpm once I restarted Nginx and the PHP service (and Redis)
nginx-restart //(custom alias I have set in .zshrc)
brew services restart php
brew services restart redis
Switching Versions
I think this will just be a matter of brew linking the desired version (if already installed), and restarting php/nginx.
brew link --overwrite --force php@8.0
I’m not totally sure what the old 7.4 is called as far as Brew is concerned. It was the default back when I installed it, so maybe it’s just php
, or possibly php@7.4
(A similar thing will probably happen now that PHP 8.1 is the default. I installed PHP 8.0 when it was, so it’s just php
. Is it now php@8.0
?)