Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've been using MAMP for quite some time for my personal web development work. It's a great App but sometimes it feels like it is dumbing down some things a little bit too much. Selecting which PHP version that is used is one of those. It appears that MAMP only gives you the option of picking the latest two PHP versions that it ships with...
phpmamp_1.png


However, you're not limited to using just those two! In fact, if you check the MAMP php directory (/Applications/MAMP/bin/php) you will see that there are multiple other versions of PHP installed there.

So in my case, MAMP had PHP 7.1.1 as the default version and the only other available choice in the UI that it was giving me was version 7.0.15. I didn't want to use PHP 7.x at all since my server was still on 5.6.x. However, MAMP came with PHP 5.6.30 but wasn't giving me the option to select it.

Fortunately you can force MAMP to allow you to select the versions of PHP that you want to use with a few directory renames!
phpmamp_2.png




The trick is to rename whichever version of PHP you do not wish to use by putting an underscore (_) character in front of the original directory name. This is done in the MAMP php directory (/Applications/MAMP/bin/php). Rename all but the two versions you are interested in using and restart MAMP. After restarting you will be able to pick either of the two versions that you didn't rename.

In my case, I renamed all versions except 7.1.1 and 5.6.30. Now I can select between PHP 5.6 and PHP 7.1 development environments.
phpmamp_3.png


I've not tried this, but if you need a completely different version of PHP that isn't shipped with MAMP, you should be able to just add it to the MAMP php directory and select it as if it was one of the shipped versions, just follow the steps above to ensure MAMP lets you select it. Also follow the naming convention used my MAMP or it won't recognise that you've added a new PHP version.

-i

Please leave your comments or feedback below!
comments powered by Disqus
Other posts you may like...
Hi! You can search my blog here ⤵
Or browse the recent top tags...

Recent Blog Posts

How to stop macOS adding shadows to window screenshots

How to run Atari Lynx games on the SNES Classic Mini

Maven dependency scopes with relation to WAR file packaging and the WEB-INF/lib directory

Hacking the Sonoff B1 WiFi LED bulb to run custom firmware

What does an idle WebLogic server run on the hour to cause a CPU spike

How to open the Sonoff B1 wifi LED bulb to access its internal circuitry

Australian release SNES mini classic unboxing and a quick play through

Troubleshooting high CPU usage for JVM threads

How to fix WebLogic high CPU usage due to a corrupted file store

Mini review of the Sonoff B1 WiFi light bulb

Recent Galleries

Atari Lynx repair - Part 5 - McWill LED screen mod installation

Atari Lynx repair - Part 4 - screen cover replacement

Atari Lynx repair - Part 2 - re-capping the motherboard

Atari Lynx repair - Part 3 - broken speaker replacement

Atari Lynx repair - Part 1 - introduction and case disassembly

Building a custom Atari Lynx game box storage shelf unit in a day

Protecting old Atari Lynx game boxes with snug fit plastic sleeves

Monument Valley 2 is released and does not disappoint

Space Food - Chocolate Ice Cream with Chocolate Chips

Legeod Star Wars AT-DP kit

Blogs and Friends

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity