Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save deepakaryan1988/9f002680902d540a956b to your computer and use it in GitHub Desktop.
Save deepakaryan1988/9f002680902d540a956b to your computer and use it in GitHub Desktop.

How To Install Memcache on MAMP 2

  1. Install memcached. I'd suggest using homebrew. brew install memcached
  2. 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.
  3. Visit the Downloads Page on php.net and download the source code. If your release isn't listed, visit the Releases page.
  4. Extract the source into /Applications/MAMP/bin/php/[php version folder]/include/php.
  5. /Applications/MAMP/bin/php/[php version folder]/include/php/configure
  6. /Applications/MAMP/bin/php/[php version folder]/bin/pecl i memcache.
  7. 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
  8. Restart Apache, then 🍺.
  9. Verify memcache is installed correctly by going to http://localhost/MAMP/phpinfo.php and +F for "memcache".

Also...

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.

Troubleshooting

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment