1

It's great now that MAMP has a memcached server and I see that it has a memcached extension.

We use the memcache extension and whilst I was able to easily configure this with PHP 5.x as there were a ton of guides I cannot seem to get this to work with PHP 7.0.20 on MAMP Pro 4.2.

Does anyone know how to get MAMP Pro 4.2 to use the memcache extension and not the memcached extension?

Lee Armstrong
  • 11,420
  • 15
  • 74
  • 122

1 Answers1

1

I had the same problem with memcache and memcached modules on MAMP 3.5.2 with PHP 7.0.8 and was able to install both modules from source code. For memcache, I used the websupport-sk git repo . Use it in your own risk. Here is steps that I followed for memcache installation

sudo su
cd /private/tmp
wget https://github.com/websupport-sk/pecl-memcache/archive/NON_BLOCKING_IO_php7.zip
unzip NON_BLOCKING_IO_php7.zip
cp -r pecl-memcache-NON_BLOCKING_IO_php7 /Application/MAMP/bin/php/php7.0.8/include/php/ext/memcache
cd /Application/MAMP/bin/php/php7.0.8/include/php/ext/memcache
phpize
./configure --enable-memcache --with-php-config=/Application/MAMP/bin/php/php7.0.8/bin/php-config
make
cp modules/memcache.so /Applications/MAMP/bin/php/php7.0.8/lib/php/extensions/no-debug-non-zts-20151012/memcache.so

Add following lines to php.ini

[memcache]
memcache_extension="/Applications/MAMP/bin/php/php7.0.8/lib/php/extensions/no-debug-non-zts-20151012/memcache.so"
extension=memcache.so

Hope this helps!

Navid
  • 894
  • 7
  • 14