Skip to content

Instantly share code, notes, and snippets.

@lasergoat
Last active March 3, 2017 17:16
Show Gist options
  • Save lasergoat/8d622def377388b3fd689f821faca17b to your computer and use it in GitHub Desktop.
Save lasergoat/8d622def377388b3fd689f821faca17b to your computer and use it in GitHub Desktop.
Steps to Install or Update PHP
# in terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# from: https://developerjack.com/blog/2016/08/26/Installing-PHP71-with-homebrew/
brew update
brew upgrade
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
# IF you installed your current PHP version through homebrew then:
# uninstall your current php
# php -v gave me php 5.6.1 so I do:
brew unlink php56
# if you were php 5.5 do unlink php55
# if it doesn't work it's because you probably still have the system installed php
# now install the latest version - right now it's 71
# but, we need mcrypt so do:
brew install php71-mcrypt
# if your unlink command didn't work, this will overrite your system php
# now install composer:
# download this file: https://getcomposer.org/installer
# After running the installer following the Download page:
# https://getcomposer.org/download/
# instructions you can run this to move composer.phar to a directory that is in your path:
mv composer.phar /usr/local/bin/composer
composer self-update
# install laravel:
composer global require "laravel/installer"
# now, add the laravel bin dir to your terminal path:
echo 'export PATH=$HOME/.composer/vendor/bin:$PATH' >>~/.bash_profile
# that command will add a line to the end of your .bash_profile file in your home directory
# when you open terminal it reads that file for your preferences
# now, for that ^^^ to take affect, open a new terminal tab
# now you can run
laravel new testproject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment