A Simple PHP Development Environment For OSX
Camp is an easy to install, zero configuration alternative to Mamp and Vagrant for learning modern PHP development. Instead of forcing you to learn about web servers and virtual machines, Camp lets you focus on PHP.
You can read the blog post about why I built camp on my blog.
Download the DMG
First you need to download the camp-installer.dmg file from here.
Drag To Install
Double click the downloaded file, then drag and drop Camp to your applications folder.
Launching Camp Terminal
You interact with Camp through the Camp Terminal. You can find it in the
Unidentified Developer Warning
Until I pay Apple $99 per year, the camp terminal is going to give you a warning dialog and not let you launch the terminal. Follow these instructions to launch it.
Once you launch the Camp Terminal, you can type
php -v to see what version you are running.
To play around with PHP from the shell, you use psysh. Just type
psysh, press enter, and you should be at a prompt ike this:
➜ ~ psysh Psy Shell v0.6.0-dev (PHP 5.6.14 — cli) by Justin Hileman >>>
Now you can run PHP code! Type this statement and press enter:
echo "hello world!"
You should see something like this:
➜ ~ psysh Psy Shell v0.6.0-dev (PHP 5.6.14 — cli) by Justin Hileman >>> echo "hello world!" hello world!⏎ => null >>>
Composer let's you download 'packages' of other peoples code and use them in your projects. You can also use it to install more PHP programs like psysh that you run from the shell.
composer --help for more info.
Sqlite is a tiny database you can use to let your apps save stuff. To use it from the terminal, just type