Skip to content

Instantly share code, notes, and snippets.

@mindmergedesign
Last active December 16, 2015 20:09
Show Gist options
  • Save mindmergedesign/5490110 to your computer and use it in GitHub Desktop.
Save mindmergedesign/5490110 to your computer and use it in GitHub Desktop.
Installing PHP PEAR PECL and DRUSH extensions on MAMP for Mac OS X 10.7 +
// We we need to add PHP's binaries to our path. The path is an environment variable that denotes which directories to look for commands in. The path can be modified by editing the ".profile" file under your home directory. I've used version 5.3.20 of PHP, but you can choose from whichever versions are available to you.
$ echo "export PATH=/Applications/MAMP/bin/php/php5.3.20/bin:$PATH" >> ~/.profile
//Now you can either restart your terminal session or run the following from your home directory to read in the new path variable.
$ . ./.profile
//You should now have the correct binaries on your path and can check this by running the "which" command again.
$ which php
/Applications/MAMP/bin/php/php5.3.20/bin/php
$ which pear
/Applications/MAMP/bin/php/php5.3.20/bin/pear
$ which pecl
/Applications/MAMP/bin/php/php5.3.20/bin/pecl
//Install Drush
$ pear channel-discover pear.drush.org
Adding Channel "pear.drush.org" succeeded
Discovery of channel "pear.drush.org" succeeded
$ pear install drush/drush
downloading drush-4.5.0.tgz ...
Starting to download drush-4.5.0.tgz (281,392 bytes)
.........................................................done: 281,392 bytes
install ok: channel://pear.drush.org/drush-4.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment