OSX Command line MAMP for use with Laravel and Composer.

I love OSX, but I always hated setting up a new system. OSX does little to empower developers out of the box.

I love OSX, but I always hated setting up a new system. OSX does little to empower developers out of the box.

I know I could use Docker or some VM to run run my development but I have never had issues syncing my local development with my server environment. I feel like a lot of those issues come from people over engineering their architecture. I get it though, its cool to be like the big boys.

When it comes to running local PHP I use MAMP because its simple. 

But its not without issue, and this has more to do with OSX than MAMP. Attempting to use Laravel you will be required to use Composer.

Installing composer is simple and you will probably even be able to install laravel and its packages but once you run an artisan command you will see “Laravel requires the Mcrypt PHP extension”.  A similar message will also show when running PHPMyAdmin.

We could fix this by using Home Brew but I like to keep things simple.

Run which php and you should see /usr/bin/php

To fix this make an edit to ~/.profile and add the following two lines.

export PATH=”/Applications/MAMP/Library/bin:$PATH”
export PATH=”/Applications/MAMP/bin/php/php5.4.4/bin:$PATH”

Obviously the PHP version in the path should machine the version you are using.

Run source ~/.profile to reload your profile and now run which php and you should now see /Applications/MAMP/bin/php/php5.4.4/bin/php

Signup for my mailing list

Receive other rambings like this on design, code, and some times food.