I installed MAMP on my mac, using the php version 7.4.
command which php
Return - /Applications/MAMP/bin/php/php7.4.21/bin/php
I have installed php 8.1 using brew. I commented ~/.bash_profile
# export PATH=/Applications/MAMP/bin/php/php7.4.21/bin:$PATH # alias mysql=/Applications/MAMP/Library/bin/mysql # export PATH="/usr/local/opt/node@13/bin:$PATH"
But it still shows the same php path. How to switch to newly installed php version?
You must link the PHP version you want to use.
brew unlink phpwill unlink the current version of PHP.brew link php@8.1Will link to PHP 8.1 (you need to install it first)