Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell MAMP which version of PHP to use?

I've installed PECL for PHP on MAMP. Unfortunately, it is using php 5.3.6 which is different form the most recent version of PHP(which is 5.4.10 today). When looking a phpinfo, I see that it is not loading the php.ini file I want (5.3.6), it is loading the latest one (which is normal)

How to tell MAMP which version of PHP to use ?

Thanks

like image 867
Miles M. Avatar asked Apr 02 '13 11:04

Miles M.


People also ask

What version of PHP does MAMP come with?

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.

How do I change the PHP version for a specific host?

Navigate to the Hosts section to change the PHP version for each individual host. More information on how to change the PHP version for an individual host is covered in the Settings > Hosts > General section. PHP has several cache extensions that can help speed up execution in certain circumstances.

How do I rename a PHP file in MAMP?

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 ).

How to check PHP version using the command line?

Check PHP Version Using the Command Line (Windows, Linux and macOS) 1. Type the PHP command: php -v 2. The php -v command works on Linux, macOS, Windows, and other supported systems. Its output contains the PHP version...


2 Answers

Check your Prefences pane. Should you want specific versions, you will need to install them manually or take a look at this thread.

enter image description here

like image 199
SMacFadyen Avatar answered Oct 21 '22 05:10

SMacFadyen


1 - Download the desired version of PHP here (listed on the right).

2 - Two cases:

Either you have Mamp pro and you can change it through the user interface or you have the free version of Mamp and can achieve that, renaming each folder with for example .DIS at the end at /Applications/MAMP/bin/php/ and just not renaming any version of php, plus the one that you are going to import and consequently copy-paste. This is because the free version of Mamp only allows you to see the two highest version of php through the user interface (for more information watch this video tutorial which will give you more details about the process to follow).

like image 20
King-Wizard Avatar answered Oct 21 '22 05:10

King-Wizard