Updating to PHP7 from PHP5

Really really quick how-to update from PHP7 from PHP5 using homebrew.

A little side note: homebrew is a package manager for MacOS. If you don’t have it, downloading it will be the best thing you ever do for your developer career: do it now.

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

And voilà:

 php -v 

screen-shot-2017-02-28-at-11-35-34-pm

Update:

For Windows, try this:

http://tektriks.com/how-to-upgrade-php-5-6-to-php-7-in-xampp-on-windows/

Troubleshoot

So there’s been cases among the members of our group and for myself as well where we would update to PHP 7 and then for some reason every time we run terminal again, it would revert itself back to PHP 5. For this try:

export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH" 

 

Advertisements

One thought on “Updating to PHP7 from PHP5

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