Installing php 7 on Mac

David Carr

1 min read - 15th Jul, 2016

Setting up a mac to run php 7 instead of the default php 5.5. 

First install Homebrew if it’s not already installed.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then run these commands in terminal:

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

Update the default php version terminal uses by opening your bash profile:

nano ~/.bash_profile

Set the PATH:

export PATH="/usr/local/sbin:$PATH"

Then press CTRL + x to save and exit.

Restart terminal and enter php -v to see the php version in use.

 

0 comments
Add a comment

Copyright © 2006 - 2024 DC Blog - All rights reserved.