by Tom Millard

Install PHP 7 on Mac with homebrew (updated)

php - php7 - homebrew - mac

Edit: Brew recently changed its syntax, in order to install the latest version of php you would need a command like this - brew install php@7.2 --with-pearm always read the output :D

Working on a mac and coding with PHP?

It's probably time to install PHP 7. It's like the second coming of christ in PHP, so why not join in.

Lets start by updating, brew:

brew update;

Un-install old version of php:

brew unlink php53 php54 php55 php56;

Then will need to install php7

brew tap homebrew/dupes;
brew tap homebrew/versions;
brew tap homebrew/homebrew-php;
brew install php70;

Install composer

brew install composer;

Run it in one command, just copy and paste this into your terminal:

wget -O - | bash