Last Updated: February 25, 2016
·
1.252K
· ashwinr

Using Your MAMP PHP version in bash

Have you ever wanted to use your PHP installation from MAMP on a Mac?
I like to keep my original PHP version separated from the MAMP version. Here's how:

alias mamphp="/applications/mamp/bin/php/php5.4.4/bin/php "

What this does is it creates an alias which leads to the path of my v5.4.4 install of PHP in MAMP.

Now, I can use "mamphp" as if it were a command and use MAMP's installation as if it were my own. This is handy, for example, if I wanted to use Laravel,which requires the Mcrypt library, which conveniently happens to be in the MAMP installation.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside