My php version is PHP 7.4.1.
But with MAMP, the highest possible php version I can use is 7.3.8.
So, when I try to open my webpage, I get the error message:
Fatal Error: composer.lock was created for PHP version 7.4 or higher
but the current PHP version is 7.3.8.
How can I downgrade my php version to fit to my MAMP version?
I tried:
brew install [email protected]
It was installed, but when I now write php --version
, I get the error:
-bash: /usr/local/bin/php: No such file or directory
2
Answers
First
and
you don’t need brew’s PHP if you want to use MAMP’s PHP.
just use
Applications/MAMP/bin/php7.3.8/bin/php --version
to use MAMP PHP, if you want to use as default command line, just link it to/usr/bin
.to link it run this to your command line:
or
check it out for more detail.
PS: Maybe you should delete your brew php to do it.