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!
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.