How to install Memcached on Mac OS X#
There are two ways to install
memcached on Mac OS X. One is the easy way, the other is the harder but more flexible way.
Installation using brew Package Manager#
Installing memcached using brew is the easy way, and it is just a matter of a single command.
$ brew install memcached
There you have memcached installed on your Mac!
Installation from Source#
Installation from source code is a little bit harder, but you have more flexibility.
Memcached is depended on
libevent, so install it first. Get the latest stable
libevent source from http://libevent.org.
$ cd /tmp $ wget https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz $ tar zxvf libevent-2.0.18-stable.tar.gz $ cd libevent-2.0.18-stable $ ./configure $ make $ sudo make install
memcached. Get the latest stable
memcached source from http://memcached.org.
$ cd /tmp $ wget http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz $ cd memcached-1.4.13 $ ./configure $ make $ sudo make install
Memcached listens on port
11211 by default, to change it, use the
$ memcached -p 8000
memcached as a daemon (background process), instead of sitting at your terminal, use the
$ memcached -d -p 8000