Follow these steps to download php. You will download the base php package then install and reset to version 8.3.
brew install php
brew install [email protected]
# Change the version number in the following command to match the base php version number.
# To find the base version number run `php -v`
brew unlink [email protected]
brew link [email protected]
# Add path to zshrc for global access to 8.3 using php
echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc
Confirm your version of php by opening a new terminal and running php -v
.
brew install composer
Confirm composer version using composer -v
.