PHP 7.0 reached end of life on 03 Dec 2018 and is no longer being updated. It's strongly recommended to upgrade to the latest version as soon as possible. You can read the official PHP migration guide here.
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 7.0.x is installed.
php -i
This will display the PHP configuration information.
echo '<?php phpinfo(); ?>' > test.php
php test.php
This should output detailed PHP configuration information.