Update PHP Version 7.0+ on Mac OS X

Roktim Sazib
Oceanize Lab Geeks
Published in
3 min readMar 12, 2019

This article i want to discuss how to upgrade php version 5.0 to 7.0+ on mac OS X, most of the developer are facing some problem to upgrade php version on mac system, so i will show vary easy to upgrade php 7 version on your system only flowing simple 4stapes.

Step 01 :

If your mac os x system already install MAMP server , first your check your MAMP version , if your MAMP server version are old like 3.0 or lower than 3.0 php 7 version are not support in your machine ,so first need to update MAMP version 5.2.

If your MAMP server have any created virtual host file then after update install update version you just copy “httpd-vhosts.conf” this file, and after install update MAMP server you just pest old virtual host file in same location.

Location of virtual host file : Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

Note : If you update MAMP version don’t worry about “htdocs” project folder ,without modify or remove htdocs folder MAMP are automatically update.

Step 02 :

After successfully install MAMP please change some configuration following screenshot

After change php version click “ports” tab to change port like screenshot

Step 03 :

Now this is the last and final step so make change carefully ,first need to open ~/.bash_profile for edit PHP path ,so please flowing this steps how to change php path

Open mac terminal to execute this code “vim ~/.bash_profile” and you can see same screen your terminal ,so now just press “E” for change edit mode

Click (E) for go to edit mode

Basics of Vim Modes

Vim is in Insert mode with the use of the a, A, i, I, o, and O commands. Once in Insert mode, the editor will stay in that mode until you press an Esc key. Every other key pressed is directly inserted into the file at the current cursor location.

Step 04 :

After add this path now need to save changes ,for save press “esc” key and then wright “:wq” and enter .if you complete all steps successfully now just Restart MAMP server

--

--

Roktim Sazib
Oceanize Lab Geeks

Hi i’m Roktim Sazib from Bangladesh. Sr.front end developer at Oceanize Inc.I have 6 year experience in this field