Skip to content

Instantly share code, notes, and snippets.

@Niteshvgupta
Last active March 1, 2023 02:15
Show Gist options
  • Save Niteshvgupta/1832ce29dee460b64d5384e4f585e7ab to your computer and use it in GitHub Desktop.
Save Niteshvgupta/1832ce29dee460b64d5384e4f585e7ab to your computer and use it in GitHub Desktop.
Install PHP7-compatible memcache on Mac OS X

1. Install PHP7 with brew

brew install php70

2. Install Memcache from source on PHP7 branch

git clone -b NON_BLOCKING_IO_php7 https://github.com/websupport-sk/pecl-memcache.git
cd pecl-memcache
phpize
./configure
make && make install

3. Add the Memcache extension to the php.ini for PHP7

vi /usr/local/etc/php/7.0/php.ini

Add extension=memcache.so under the extensions section.

@NewZeal
Copy link

NewZeal commented Apr 1, 2022

For those getting make: *** No targets specified and no makefile found. Stop. Check that zlib was present when running ./configure. If not then the second answer here works: https://stackoverflow.com/questions/29726890/pecl-install-memcache-fails-on-os-x-yosemite-with-memcache-support-requires-zli

Follow the instructions for installing zlib and run ./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11 making sure you have the same version of zlib.

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