I am trying to get MAMP runing with PHP 8.1 but what I see as latest version for MacOS is 8.0.8, is there a way to run 8.1 ?
I have gone thru many tutorials in which they explain on how to switch from one of the installed versions but I can’t seem to find a way to install additional PHP versions.
4
Answers
I was looking for this myself. I found out that the easiest way to do this is to start your trial version of the pro. There you have the option to download/ install the php8.1 version. After this I switched back to the basic MAMP and everything is working properly
following up relating to @Quink’s answer
8.1.0 is available in the dropdown (not in the picture because I already downloaded it)
then quit and restart mamp
then you can find the folder by opening phpinfo page and seeing the path
not sure if this is needed, but at this point I copied the folder and pasted it in the main MAMP/conf directory where all the other PHP versions are
This YouTube Video answers this perfectly, and then follow this SO answer
You might also want to change your local connection host from
localhost
to127.0.0.1
PS: Copy
/usr/local/Cellar/php/8.<version_number>/lib/httpd/modules/libphp.so
to/Applications/MAMP/bin/php/php8.<version_number>/modules/libphp.so
Install homebrew
get latest php version i.e. 8.1 for now
Verify php
now go to to /usr/loca/Cellar/php, copy php version folder you want i.e. 8.1 for now
go to Application/MAMP/bin/php and paste this folder
rename your folder like others i.e. "8.1.10_1" to "php8.1.10" in my case
at this point you can quite the mamp and reopen it and you will see php8.1 version in your mamp php version’s dropdown
now go to your terminal and
and you will see an error i.e. Syntax error on line 160 of /Applications/MAMP/conf/apache/httpd.conf… in my case
to resolve this go to /usr/local/lib/httpd/ and copy the "modules" folder
now past it in /Applications/MAMP/bin/php/php8.1.10/
YOUR MAMP IS ALL SET BUT if you try to reach phpadmin you will see an error, for that
go to /Applications/MAMP/bin/phpMyAdmin5 and edit config.inc.php.
Locate this text:
$cfg['Servers'][$i]['host'] = 'localhost'
and change it to “$cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’`Restart your server.
HOPE THIS HELP YOU