Skip to content

Instantly share code, notes, and snippets.

@it4need
Forked from vukanac/install-php72-osx.md
Created March 13, 2018 19:29
Show Gist options
  • Save it4need/b45d62f07aff688c0f73e5a896f3b5c8 to your computer and use it in GitHub Desktop.
Save it4need/b45d62f07aff688c0f73e5a896f3b5c8 to your computer and use it in GitHub Desktop.
How to install php72 on Mac OS X with homebrew.

Skip this:

brew tap homebrew/dupes
brew tap homebrew/versions

As:

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.

Both are moved to homebrew - core. This is only required:

brew tap homebrew/homebrew-php

brew options php72
brew install php72


echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.zshrc
# LDFLAGS:  -L/usr/local/opt/gettext/lib
# CPPFLAGS: -I/usr/local/opt/gettext/include

echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc

# LDFLAGS:  -L/usr/local/opt/icu4c/lib
# CPPFLAGS: -I/usr/local/opt/icu4c/include

# LDFLAGS:  -L/usr/local/opt/libxml2/lib
# CPPFLAGS: -I/usr/local/opt/libxml2/include


echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

# LDFLAGS:  -L/usr/local/opt/openssl/lib
# CPPFLAGS: -I/usr/local/opt/openssl/include

echo 'export PATH="$(brew --prefix homebrew/php/php72)/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="$(brew --prefix homebrew/php/php72)/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix homebrew/php/php72)/bin:$PATH"' >> ~/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment