Install latest PHP version on Mac using homebrew

Check php latest version here: http://php.net/downloads.php
=> Update your homebrew

$ brew update
$ brew upgrade

=> Install a centralized repository for PHP-related brews: homebrew-php
https://github.com/Homebrew/homebrew-php

Requirements
* Homebrew
* Yosemite, El Capitan, and Sierra. Untested everywhere else.

Run the following in your command-line:

$ brew tap homebrew/homebrew-php

$ brew search php

will show you all php formula

We will Install php 7.1, because php 7.1.8 is the latest stable version till now (Aug 2017)

$ brew install php71

Check php version installed

$ php --version
PHP 7.1.8 (cli) (built: Aug  7 2017 15:02:19) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

You are done.

Advertisements

Author: Abhilash

Hi, this is Abhilash - Senior Programmer Analyst at CoMakeIT, specialised on web programming. Mainly working on Ruby On Rails platform since 2010.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s