From 8bc8ea91f7aa116a783483829a0f7a0c5fb15f83 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 23 Sep 2014 17:16:47 -0400 Subject: [PATCH] Revised Mac OSX Install instructions. --- _posts/01-04-01-Mac-Setup.md | 39 ++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/_posts/01-04-01-Mac-Setup.md b/_posts/01-04-01-Mac-Setup.md index 3aed1e6..36542b1 100644 --- a/_posts/01-04-01-Mac-Setup.md +++ b/_posts/01-04-01-Mac-Setup.md @@ -5,22 +5,39 @@ anchor: mac_setup ## Mac Setup {#mac_setup_title} -OSX comes prepackaged with PHP but it is normally a little behind the latest stable. Lion comes with PHP 5.3.6, -Mountain Lion has 5.3.10, and Mavericks has 5.4.17. +OS X comes prepackaged with PHP but it is normally a little behind the latest stable. Mountain Lion has +5.3.10, Mavericks has 5.4.17 and Yosemite has 5.5.9, but with PHP 5.6 out that is often not good enough. -To update PHP on OSX you can get it installed through a number of Mac [package managers][mac-package-managers], with -[php-osx by Liip][php-osx-downloads] being recommended. +There are multiple ways to install PHP on OS X. -The other option is to [compile it yourself][mac-compile], in that case be sure to have installed either Xcode or -Apple's substitute ["Command Line Tools for Xcode"][apple-developer] downloadable from Apple's Mac Developer Center. +### Install PHP via Homebrew -For a complete "all-in-one" package including PHP, Apache web server and MySQL database, all this with a nice control -GUI, try [MAMP][mamp-downloads] or [XAMPP][xampp]. +[Homebrew](http://brew.sh/) is a powerful package manager for OS X, which can help you install PHP and +various extensions easily. [Homebrew PHP] is a repository that contains PHP-related "forulae" for Homebrew, +and will let you install PHP. -[mac-package-managers]: http://www.php.net/manual/en/install.macosx.packages.php +At that point, you can install `php53`, `php54`, `php55` or `php56` using the `brew install` command, and switch between then by modifying your `PATH` variable. + +### Install PHP via phpbrew + +[phpbrew] is a tool for installing and managing multiple PHP versions. This can be really useful if two +different applications/projects require different versions of PHP, and you are not using virtual machines. + +### Compile from Source + +Another option that gives you control over the version of PHP you install, is to [compile it yourself][mac-compile]. +In that case be sure to have installed either Xcode or Apple's substitute ["Command Line Tools for XCode"] +downloadable from Apple's Mac Developer Center. + +### All-in-One Installers + +The solutions listed above mainly handle PHP itself, and do not supply things like Apache, Nginx or a SQL server. "All-in-one" solutions such as [MAMP][mamp-downloads] and [XAMPP][xampp] will install these other bits of software for you and tie them all together, but ease of setup comes with a trade-off of flexibility. + +[Homebrew]: http://brew.sh/ +[Homebrew PHP]: https://github.com/Homebrew/homebrew-php#installation [mac-compile]: http://www.php.net/manual/en/install.macosx.compile.php [xcode-gcc-substitution]: https://github.com/kennethreitz/osx-gcc-installer -[apple-developer]: https://developer.apple.com/downloads +["Command Line Tools for XCode"]: https://developer.apple.com/downloads [mamp-downloads]: http://www.mamp.info/en/downloads/index.html -[php-osx-downloads]: http://php-osx.liip.ch/ +[phpbrew]: https://github.com/phpbrew/phpbrew [xampp]: http://www.apachefriends.org/en/xampp.html