Setting Up Apple OSX Using Homebrew
These are the instructions to prepare your OSX machine for running Storyplayer. These instructions use Homebrew, a package manager that makes it easy to install open-source software onto OSX.
We recommend that you get your copy of PHP from either Homebrew or Macports, rather than use the version of PHP supplied with OSX. You’ll end up with a more up-to-date version of PHP, and you’ll find it much easier when you want to compile and install PHP extensions.
Storyplayer will work equally well with both, but if you’re not sure which one to choose, Stuart uses Macports.
- Install Xcode from the App Store. It’s free. This gives you a C/C++ compiler and Git for version control.
Install the Xcode CLI tools:
Agree to the Xcode license, so that the CLI tools work:
sudo xcodebuild -license
PHP Using Homebrew
- Install Homebrew if you don’t already have it.
Run these commands in Terminal:
brew doctor brew install openssl brew install homebrew/php/php56 --with-brewed-openssl brew install homebrew/php/php56-uuid brew install homebrew/php/php56-zmq
Make sure that
/usr/local/sbinare at the front of your PATH. (This is the default behaviour on OSX Yosemite.) You can check this by running:
You should see
/usr/local/bin/phpas the answer.
/usr/local/etc/php/5.6/php.iniand change the following settings:
date.timezone = UTC
Create the file
/usr/local/etc/php/5.6/conf.d/ext-opcache.ini, with this content:
Download and install Composer
Composer is the modern package manager for PHP libraries. You’ll use Composer to install Storyplayer into your projects.
Other CLI Tools
Run this command in Terminal to install GNU Screen:
brew install screen
OSX does already include
screen, but unfortunately it doesn’t behave quite the same as the original GNU Screen. Storyplayer needs the original!
Virtual Machine Tools
Download and install VirtualBox.
VirtualBox is a free Virtual Machine (VM) solution from Oracle. Because it is free, it is widely used in the software development community.
Download and install Vagrant.
Vagrant is a CLI tool to manage creating and destroying virtual machines. It’s most often used with VirtualBox.
Download and install a Java VM for OSX.
Storyplayer uses Selenium v2 aka WebDriver to control real web browsers. Selenium is written in Java.
Storyplayer can use these browser for testing websites.
At the time of writing (January 2015), Selenium WebDriver doesn’t work out-of-the-box with Apple’s Safari. More details can be found here.
When you get to here, your Apple laptop or desktop should be all setup for Storyplayer, and any other CLI apps written in PHP. Test your setup to make sure!Tweet