Skip to content

Instantly share code, notes, and snippets.

@colynb
Last active August 29, 2015 14:12
Show Gist options
  • Save colynb/09734bcef5b32455abae to your computer and use it in GitHub Desktop.
Save colynb/09734bcef5b32455abae to your computer and use it in GitHub Desktop.
Install PHP on OSX

There are many ways to get the latest PHP version running on your mac, but so far the one that seemed the least complicated is to use phpbrew

Start here: https://github.com/phpbrew/phpbrew

From there, there are instructions for getting PHP installed. It's also used as a version switcher, which can be useful for managing multiple projects with different version requirements.

I noticed, the build failed because of a missing component called "libmcrypt". To fix that I just installed that with homebrew:

$ brew install libmcrypt

Once you have that all set up properly, you can install the specific version of PHP you want:

$ phpbrew install 5.6.4 +default

Then use that version:

$ phpbrew switch php-5.6.4

You can check to make sure you're on the correct version:

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