This is a requirement for brew in the next step. You can install XCode and then install Command Line Tools through the XCode preferences, or you can install just the Command Line Tools.
$ xcode-select --install
A version of the X.Org X Window System that runs on OS X
Download and install xquartz.macosforge.org
Homebrew or Brew is a package manager for OS X and will allow us to install PHP, MySQL and nginx.
-
Open a Terminal window
-
Install brew
$ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
1. Make sure your system is ready to brew!
```bash
$ brew doctor
- Now update brew so we're installing the latest packages
$ brew update
- Install wget
$ brew install wget
- Edit your bash profile
$ nano ~/.bash_profile
-
Put the following lines at the bottom (don't worry if this file is empty!)
PATH=/usr/local/sbin:/usr/local/bin:$PATH;
source brew --prefix
/Library/Contributions/brew_bash_completion.sh
1. Save and exit with `CTRL` + `O`, `Return` and then `CTRL` + `X`
1. Reload bash profile without relogging
```bash
$ source ~/.bash_profile
Only do this if you'd like to use Git as part of your development process.
-
Install
$ brew install git
1. Configure
```bash
$ git config --global user.name "your name here"
$ git config --global user.email "your email here"
-
I don't like vi so let's use nano instead
$ git config --global core.editor "nano"
1. Let's get some colour coding in our Git shell! *(optional)*
```bash
$ git config --global color.ui true
- Let's get Git info in our shell! Follow the instructions here (optional)
Visit the amazing
brew-emp
Homebrew (E)nginx MySQL PHP Installer and follow the instructions!
brew-emp
installs the PHP extensionmemcached
, installing thememcache
extension as well adds support for more projects, such as CakePHP out of the box.
$ brew install php55-memcache
MySQL ships with no root password and an anonymous account and lets anyone connect from your LAN. If you're at a conference or just in the office, that means anyone can access your databases with root!
$ mysql_secure_installation
...and follow the prompts.
The Dependency Manager for PHP
$ curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin
This way allows us to perform
composer selfupdate
without ill effects.
@hackzilla thanks for the heads up on the
composer.phar
! As for the nginx as root bit,brew-emp start
will ask you for a password and run nginx on port 80. I avoided talking about LaunchDaemons to keep it manually controlled.