Using memcached with stock OS X Apache 08 December 2010
I wanted to use memcached but didn’t want to compile all the dependencies by hand and wanted to use the stock version of Apache that ships with OS X so I cobbled together the following instructions.
Use MacPorts to install memcached:
sudo port install memcached
Use pecl
to download the latest version of memcached
and uncompress it:
cd /tmp
pecl download memcached
tar xvzf memcached-*.tgz
Build the extension using MacPort’s version of libmemcached
(which was
installed as a dependency of memcached
):
cd memcached-*/
phpize
./configure --with-libmemcached-dir=/opt/local/
sudo make install
Enable it by editing php.ini
and adding the following line:
extension=memcached.so
Restart Apache:
sudo apachectl graceful