- Install memcached. I'd suggest using homebrew.
brew install memcached
- Select your desired version of PHP that you'd like to use in MAMP. This dropdown is located in the PHP tab in MAMP PRO.
- Visit the Downloads Page on php.net and download the source code. If your release isn't listed, visit the Releases page.
- Extract the source into
/Applications/MAMP/bin/php/[php version folder]/include/php
. /Applications/MAMP/bin/php/[php version folder]/include/php/configure
/Applications/MAMP/bin/php/[php version folder]/bin/pecl i memcache
.- Add
extension=memcache.so
to your php.ini- MAMP Pro:
/Applications/MAMP\ Pro/MAMP\ PRO.app/Contents/Resources/php[your php version].ini
- MAMP:
/Applications/MAMP/conf/php[your php version].ini
- MAMP Pro:
- Restart Apache, then 🍺.
- Verify memcache is installed correctly by going to
http://localhost/MAMP/phpinfo.php
and ⌘+F for "memcache".
Once you have your local binaries properly configured, you can essentially install any other php extension by using that pecl
binary. pear
, php
and phpize
should work as well.
Make sure pecl compiled the memcache extension to the correct place. It should be in a folder named: /Applications/MAMP/bin/php/[PHP VERSION FOLDER]/lib/php/extensions/no-debug-non-zts-20060613
Inspired by this tutorial, and gisted in case it ever went down.