Skip to content

Instantly share code, notes, and snippets.

@imcarvalho
Last active May 10, 2018 10:46
Show Gist options
  • Save imcarvalho/b8af4622380aa5310499 to your computer and use it in GitHub Desktop.
Save imcarvalho/b8af4622380aa5310499 to your computer and use it in GitHub Desktop.
Install extensions on MAMP 3.5 and Mac OSX 10.11 tutorial

I'm using PHP 5.6.10, and trying to install the memcache extension. You can adapt this to other PHP versions and to other extensions, of course 😄

  • Download the version of PHP you're using from php.net.
  • At /Applications/MAMP/bin/php/php5.6.10, create a directory named include.
  • Inside /Applications/MAMP/bin/php/php5.6.10/include (your newly created folder), untar the php file you downloaded from php.net.
  • For me, it produced a folder named "php-5.6.10". Rename it to "php". Now you'll have this structure: /Applications/MAMP/bin/php/php5.6.10/include/php
  • Go to that folder on terminal, and run ./configure
  • Then, go to /Applications/MAMP/bin/php/php5.6.10/include/php/bin
  • Run, for instance: sudo /Applications/MAMP/bin/php/php5.6.10/bin/pecl install memcache
  • Afterwards, edit your php.ini file (/Applications/MAMP/bin/php/php5.6.10/conf/php.ini), and add the line extension=memcache.so
  • Restart apache (on MAMP)
  • Profit!
@danmcadams
Copy link

danmcadams commented May 5, 2016

You saved me. I love you.

Jamie, I went ahead and made the extension myself.

After you run ./configure in /Applications/MAMP/bin/php/php5.6.10/include/php

Go to the extension dir you want to build. For me it was /Applications/MAMP/bin/php/php5.6.10/include/php/ext/pcntl

I then ran make. After running make test and verifying the tests ran I copied pcntl.so from pcntl/modules/ to /Applications/MAMP/bin/php/php5.6.10/lib/php/extensions/no-debug-non-zts-20131226 and everything worked.

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