How to change PHP version on MAMP 4.1 How to change PHP version on MAMP 4.1 php php

How to change PHP version on MAMP 4.1


As mentioned by @Scott in the comments under your question:

Your here is the right link. Use the bottom answer to rename the bin/php directory. The MAMP preference pane will show the 2 latest versions in the php directory. – Scott Eisenberg

And the answer in that links is:

First stop the Server if its running. Go to "/Applications/MAMP/bin/", rename the PHP Version you don't need (MAMP is only allowed to use 2 PHP Versions), e.g. "_php5.2.17". Now MAMP will use the php versions that are left. Go to the MAMP Manager and then settings, then switch to the php version you need.

In my case (and similarly yours), I renamed the folder named php7.1.1 to _php7.1.1 and now MAMP shows me 5.6.30 and 7.0.15 in the preferences pane.


This is how my 'php' folder look like

Current php folder

Created another folder 'php-versions' and moved all versions, and kept only two version which I wanted in the 'php' folder. And restarted the Mamp, go the version '5.6.31'

Later my 'php' folder


I am using MAMP version 4.5. I changed php version on the httpd.conf:

/Applications/MAMP/conf/apache/httpd.conf

I wanted to the version to php7.1 so here is what I did:

Original line:

LoadModule php7_module        /Applications/MAMP/bin/php/php7.2.1/modules/libphp7.so

Updated line:

LoadModule php7_module        /Applications/MAMP/bin/php/php7.1.12/modules/libphp7.so

It worked for me!