PHP 8.1 reached end of active support on 25 Nov 2023. As of today, PHP 8.1 is only receiving security related updates through 31 Dec 2025, at which point it will be considered end-of-life and receive no further updates. It's strongly recommended to upgrade to the latest version of PHP before then.
brew update
brew install [email protected]
brew link [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
php -v
You should see output indicating PHP 8.1.x
php -i
This will display detailed PHP configuration information
php -r "echo 'PHP 8.1 is working!';"
This should output: PHP 8.1 is working!