Sunday, February 11, 2018

OSX MAMP, Update PHP Version

Hello,

So recently I was working on Laravel Lumen framework where we need PHP 7.1.3 version. In my OSX XAMPP was using php version 7.1.1

So here in this blog I am going to explain step by step procedure.

Step 1: Go to MAMP website and download the new version of PHP. Go to following link

MAMP Downloads

On left side you will see column with title "Additional PHP versions"

There you will find list of PHP versions for OSX, download the one which you want and extract it. Copy it to

MAMP\bin\php folder.

For example if you download php version 7.1.3 then you will get folder with name

php7.1.3

Now you have to make two changes.

First edit path in your bash profile and update the existing path of PHP to newer version.


export PATH=/Applications/MAMP/bin/php/php7.1.3/bin:$PATH

After this quit the MAMP and restart it. It should work. No wait still it may not work for you.  As you go to MAMP preference screen, you will see that still it's using old version and new version is not displayed there.


That's because, by default free version of MAMP displays only last two folder here. So trick is to delete old folder or rename it and now your version of PHP will be displayed. Select it click on OK, restart MAMP and that's it now you get newer version of PHP. 

Hope this helps you.



No comments:

Post a Comment