The short answer: Either one is what you are looking for, but my first choice would be memcache (the first one you listed), purely based on its correct use of nomenclature.
Now here's how I came to that conclusion:
Here is a quick backgrounder in naming conventions (for those unfamiliar), which explains the frustration by the question asker: For many *nix applications, the piece that does the backend work is called a "daemon" (think "service" in Windows-land), while the interface or client application is what you use to control or access the daemon. The daemon is most often named the same as the client, with the letter "d" appended to it. For example "imap" would be a client that connects to the "imapd" daemon.
This naming convention is clearly being adhered to by memcache when you read the introduction to the memcache module (notice the distinction between memcache and memcached in this excerpt):
Memcache module provides handy
procedural and object oriented
interface to memcached, highly
effective caching daemon, which was
especially designed to decrease
database load in dynamic web
applications.
The Memcache module also provides a
session handler (memcache).
More information about memcached can
be found at »
http://www.danga.com/memcached/.
The frustration here is caused by the author of the PHP extension which was badly named memcached, since it shares the same name as the actual daemon called memcached. Notice also that in the introduction to memcached (the php module), it makes mention of libmemcached, which is the shared library (or API) that is used by the module to access the memcached daemon:
memcached is a high-performance,
distributed memory object caching
system, generic in nature, but
intended for use in speeding up
dynamic web applications by
alleviating database load.
This extension uses libmemcached
library to provide API for
communicating with memcached servers.
It also provides a session handler
(memcached).
Information about libmemcached can be
found at »
http://tangent.org/552/libmemcached.html.
In summary, both are functionally the same, but they simply have different authors, and the one is simply named more appropriately than the other.
Memcached is the name of the Memcache daemon.
Using Memcache with PHP you are able to store PHP sessions in memory rather than in separate files on disk. This results in many times faster session management. This is especially useful when you've set up a load balancer and a few web app servers behind it but you plan to share sessions for each of your servers. You can run memcache on one of your servers or a separate server and make all your servers cache to the one running Memcache.
To get started:
sudo apt-get install memcached
Go through the config file in /etc/memcached/memcached.conf and see if the defaults are good for you.
Now install php's memcache client
sudo apt-get install php5-memcache
When asked, enable session handler support. Also, add
extension=memcache.so
and
session.save_handler = memcache
session.save_path = "tcp://10.0.0.1:11211"
to your php.ini (probably in /etc/php5/apache2/php.ini). Change the ip to your memcache server address or to 127.0.0.1 if you run it locally.
Start the service with
/etc/init.d/memcached start
Before installing anything, you really should read up on what the package does otherwise you will not be able to get the most out of it.
Best Answer
@Alin Andrei posted the right answer for this question. I am quoting him here since the answer is hidden in the comments. The credit goes to him: