Installing membase/memcached

These are instructions for getting membase/memcached installed in your local environment.
(I was installing on windows so your setup might be a little different, but general approach is mostly the same).

1. Download the membase server for your OS (community edition is the one you are after):

Once downloaded, the installation is quite simple. Just follow the prompts.
After the server installation is complete, your default browser should open and you will be prompted to continue setting up the “cache bucket”.

Again, it is a simple step by step process. The only thing you’d want to make sure is that you select memcached bucket type.
(This will be 100% compatible with any other default installation).

2. Make sure you have memcache support enabled in your PHP install.
The easiest way to find out is to check the output of phpinfo(). Look for the “memcache” section.

3. What to do if you don’t see the section mentioned above?
First, check your php.ini for: extension=php_memcache.dll (, on *nix platforms).
In some cases you just might need to uncomment the line above.

Next, you should have an entry for the php/memcached settings, it should look something like this:

memcache.allow_failover = 1
memcache.max_failover_attempts = 20
memcache.chunk_size = 8192
memcache.default_port = 11211

In my case the php_memcache.dll was missing, so I downloaded the appropriate version from:

You’ll have to place the .dll or .so with the rest of your php extensions; if your are using XAMPP it will be somewhere like:

4. Configure cake
Open up app/config/core.php and scroll all the way down to the cache settings.
Presuming you’ve installed everything with all defaults, all you’d have change is:
‘engine’ => ‘File’ to ‘engine’ => ‘Memcache’

5. Restart your web server.
You might want to clear your model cache first, to be sure that cake doesn’t fall back on File caching if something isn’t configured properly.
If all goes well, you should see no warnings, nothing should be written to the file system, and in your membase console (Monitor -> Data Buckets -> default) you should begin to see some activity.
(Chart should be updated, as well you should see some records under TOP KEYS).

Congrats, you are now using memcached as your caching mechanism.

Good luck!

Related Posts