Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Owner Author

commented Apr 20, 2018

Thanx!

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

@f3l1x

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.