Upgrading with Homebrew (Mac)
You can check the current PHP version and PATH by running:
which php
Start by making sure brew is up-to-date:
brew update
Next, upgrade PHP. You can either use the built-in php recipe, use tap shivammathur/homebrew-php. I'd recommend the second approach, since it allows you to easily install several PHP versions and switch between them.
Normal upgrade
brew upgrade php
Upgrade with shivammathur/homebrew-php
brew tap shivammathur/php
brew install shivammathur/php/php@8.1
To switch between versions, use the following command:
brew link --overwrite --force php@8.1
Upgrading on Windows
Coming soon!
