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!
@JamiePoole
Copy link

Hi there, I'm trying to go through this process too -- however after I configure the PHP source, I have no /php/bin folder -- and when I try and run pecl install it returns an error:

running: phpize
Cannot find config.m4.
Make sure that you run '/Applications/MAMP/bin/php/php5.6.10/bin/phpize' in the top level source directory of the module

ERROR: 'phpize' failed

Did you come across this?

@learn2reid
Copy link

Hi, I'm trying to update the version of PHP to 5.6.20 would you happen to know if this would help me? thanks!

@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