MacOS MAMP and php 8.1

Viewed 4380

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

following up relating to @Quink's answer

add additional php versions

8.1.0 is available in the dropdown (not in the picture because I already downloaded it)

then quit and restart mamp select 8.1.0

then you can find the folder by opening phpinfo page and seeing the path enter image description here

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

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

This YouTube Video answers this perfectly, and then follow this SO answer

You might also want to change your local connection host from localhost to 127.0.0.1

Install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

get latest php version i.e. 8.1 for now

brew install php

Verify php

which php
php -version

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

/Applications/MAMP/Library/bin/apachectl start

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

Related