Skip to content

Instantly share code, notes, and snippets.

@emotality
Last active March 13, 2022 14:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emotality/585941ab34738e0553610cbc2ba87a32 to your computer and use it in GitHub Desktop.
Save emotality/585941ab34738e0553610cbc2ba87a32 to your computer and use it in GitHub Desktop.
Install PHP 7.2 on macOS

PHP 7.3 on macOS

Install PHP

$ curl -s https://php-osx.liip.ch/install.sh | bash -s force 7.3

Add path to your bash profile to access it globally:

$ echo 'export PATH="/usr/local/php5/bin:$PATH"' >> ~/.bash_profile

If you are using Oh My Zsh:

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

Reopen your Terminal windows or

$ source ~/.bash_profile
$ source ~/.zshrc

Verify installation

$ php -v
@n3omaster
Copy link

Excelent! This worked for me.

@abdullah715
Copy link

Excelent !

you could do this if your a using MAMP
echo 'export PATH="/Applications/MAMP/bin/php/php8.0.8/bin:$PATH"' >> ~/.zshrc

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