Skip to content

Instantly share code, notes, and snippets.

@vukanac
Created August 20, 2017 19:26
Show Gist options
  • Save vukanac/e32c71d0d7c1444a1ac61469181ccaa6 to your computer and use it in GitHub Desktop.
Save vukanac/e32c71d0d7c1444a1ac61469181ccaa6 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
@v1ncen
Copy link

v1ncen commented Mar 21, 2018

Thanks for sharing,
But it should be:
export PATH="$(brew --prefix php)/bin:$PATH"

instead of:
export PATH="$(brew --prefix homebrew/php/php72)/bin:$PATH"

Otherwise you'll get this warning:
Warning: Use php instead of deprecated homebrew/php/php72

@vukanac
Copy link
Author

vukanac commented Apr 20, 2018

Thanx!

To save you a few clicks:
echo 'export PATH="$(brew --prefix php)/bin:$PATH"' >> ~/.zshrc

@f3l1x
Copy link

f3l1x commented May 16, 2018

$ brew tap homebrew/homebrew-php
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment