$ /Applications/MAMP/bin/php/php5.3.6/bin/php -v If this doesn't work make sure that your PHP binaries have execute permissions, an easy way to tell is by running Applications/MAMP/bin/php/php5.3.6/bin/pecl Applications/MAMP/bin/php/php5.3.6/bin/pear Applications/MAMP/bin/php/php5.3.6/bin/php You should now have the correct binaries on your path and can check this by running the " which" command again. Now you can either restart your terminal session or run the following from your home directory to read in the new path variable. $ echo "export PATH=/Applications/MAMP/bin/php/php5.3.6/bin:$PATH" > ~/.profile I've used version 5.3.6 of PHP, but you can choose from whichever versions are available to you. The path can be modified by editing the ". The path is an environment variable that denotes which directories to look for commands in. To rectify this we need to add PHP's binaries to our path. Here is an example for installing PHPUnit.Įasy! Unfortunately, if we try this after we've installed MAMP we'll get an error as the " pear" command can't be found and running " php" will point us to OS X's default version. The usual method for installing PEAR and PECL components is via the command line.
In this article, you'll learn how to get them running on the latest version of MAMP (2.x). PECL (PHP Extension Community Library) and PEAR (PHP Extension and Application Repository) both provide access to a large pool of useful PHP add-ons, but using them with MAMP requires you to do a bit of extra configuration. If you're developing a site that needs additional PHP extensions like the Memcached library or exotic database drivers, you'll need to use the PEAR and PECL tools to build and install them. Unfortunately, MAMP doesn't include everything.
The newest version of MAMP includes a graphical configuration tool, a choice of PHP versions, web-based tools for administering your databases, and a variety of useful PHP extensions. OS X does ship with its own built in versions of these tools, but MAMP adds lots of goodies.
MAMP is an easy to install set of tools for that provides a great local development environment for Mac users ( Mac Apache MySQL PHP).