If you're working on a project that requires a version of PHP higher than the versions that MAMP comes with, you can easily add additional verions.
My version of MAMP came installed with PHP 7.4.21 and 8.0.8. I'm attempting to use MAMP to host a Laravel application which requires at least PHP 8.1.
The version of PHP MAMP uses is often different than the version you have installed. I have installed PHP using Brew. I'm currently running PHP 8.1.8. If you want to check your installed version of PHP, use the terminal and run the following command:
php --version
-
First we need to copy the installed PHP files to MAMP. Using Finder, navigate to
/usr/local/Cellar/php
and you should find a folder named after the installed version of PHP. For me it was8.1.8
. Copy this folder. -
Navigate to the folder that MAMP stores PHP versions. For me this was
/Applications/MAMP/bin/php
. Paste this folder here. -
Rename this folder to
php8.1.8
(use your PHP version number). -
Next we need the PHP modile file. Navigate to
/usr/local/lib/httpd
and copy themodules
folder. Inside this folder is the PHP module file nameslibphp.so
. -
Navigate to
/Applications/MAMP/bin/php/php8.1.8
and paste the modules folder. -
Close and restart MAMP.
-
Choose PHP 8.1.8 from the frop down and you should be good to go!
I have a video walk-through on YouTube!
hey guys, Im trying to get this to work, I only tried to run the server with the defaults and the php version that comes right now, which is 8.3.8 but when I start the server there's this error
'Apache couldn't be started. Please check your MAMP installation and configuration.'
looking into the logs theres this error
/Applications/MAMP/fcgi-bin/php.fcgi: line 4: exec: /Applications/MAMP/bin/php/php8.3.1/bin/php-cgi: cannot execute: No such file or directory
this error shows up when I run the apachectl Im not sure what to do, also anyways I need to work with a previous version 7.0.33 which is previous, does the tutorial work for previous versions ?