Skip to content

Instantly share code, notes, and snippets.

@bartmika
Last active August 19, 2022 13:44
Show Gist options
  • Save bartmika/a5b4d443f9359b8d693f to your computer and use it in GitHub Desktop.
Save bartmika/a5b4d443f9359b8d693f to your computer and use it in GitHub Desktop.
Instructions on setting up memcached on FreeBSD and OS X.

FreeBSD 10.2 + Memcached

The following instructions are used to setup Memcachd on your FreeBSD OS.

  1. Install from ports (1 of 3) if you plan on using PHP with caching:
cd /usr/ports/databases/pecl-memcache
make install clean
  1. Install from ports (2 of 3):
cd /usr/ports/databases/memcached
make install clean
  1. Install from ports (3 of 3) the library which we can use in our webapps (Python Django):
cd /usr/ports/databases/libmemcached
make install clean
  1. Edit /etc/rc.conf and add the following.
memcached_enable="YES"
  1. Start MemCached with
/usr/local/bin/memcached -d -u nobody
  1. Confirming MemCached is running by run the following call and confirm that a process is listening on TCP 11211
netstat -an
  1. (OPTIONAL) It may also be useful to run:
/usr/local/bin/php -i | grep -i 'memcache'

Apple Mac OSX: Yosemite + Memcached

  1. Install brew.

  2. Run the following command:

brew install memcached
brew install libmemcached
brew install zlib
brew install libsas12
  1. To startup the cache, run the following.
/usr/local/bin/memcached -d -u nobody
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment