Search code examples
phpmemcachedmampphp-extension

Can't install memcached.so extension for MAMP's PHP 5.6.2 on OS X 10.10?


I have installed memcached, libmemcached with brew, downloaded the memcached PECL extension, compiled it, by following this tutorial -> https://donatstudios.com/OS-X-Mavericks-Memcached-PHP-Extension-Installation

And then I have copied memcached.so to MAMP's extension dir:

cp /tmp/memcached/memcached-2.2.0/memcached-2.2.0/modules/memcached.so /Applications/MAMP/bin/php/php5.6.2/lib/php/extensions/no-debug-non-zts-20131226/

And added the line extension=memcached.so into /Applications/MAMP/bin/php/php5.6.2/conf/php.ini, which is my PHP conf file according to the MAMP phpinfo.
But I get the following error in MAMP/logs/php_error.log:

[19-Nov-2014 09:40:16 Europe/Berlin] PHP Warning:  PHP Startup: memcached: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0

What's the problem with my configuration?

How can I resolve and install this memcached extension once for all???


Solution

  • I was able to resolve thanks to these two pages:

    Having problems while try to install OAUTH with PECL in MAMP on mac OS lion

    and

    http://verysimple.com/2013/11/05/compile-php-extensions-for-mamp/