mamp-php-1MAMP is a quick and easy tool to set up Apache, MySQL and PHP in our localhost computer. Its standard version is free, available from www.mamp.info/en/. The Pro version offers advanced features from unlimited virtual servers, running multi-PHP, one-click installation of popular CMS, dynamic DNS, SMTP and Apache switch. Professional developers might need some of the Pro features. For me to manage digital development projects, the standard version is already sufficient.

The standard version of MAMP comes with PHP 5.1.6, 5.2.17, 5.3.29, 5.4.42, 5.5.26 and 5.6.10. However, the preference panel of MAMP only allows us to choose between running PHP 5.5.26 or 5.6.10. To test PHP compatibility, I needed to run a system using PHP 5.3 and was trying to figure out how.

mamp-php-2

mamp-php-3A colleague of mine figured out a very simple way to do that. Quit MAMP if it’s running, go to the location of MAMP installation (I’m using Mac so it’s in Applications folder), then find bin/php folder. There you will find the versions of PHP available. MAMP will simply detect 2 most recent versions there and offer us to use them in the preference panel. So if I want to use PHP 5.3, all I need to do is to rename the folders of PHP 5.4, 5.5 and 5.6 by adding an underscore at the beginning. Start MAMP again and see that it now offers PHP 5.2 and 5.3 as they are 2 most recent versions that we didn’t rename.

That’s it. Now you have full control on which PHP version to use. I hope you find it useful.