i'm planning on using membase for my website and i was really struggling to install the memcashed php client on ubuntu with pear, but actually there is an easier way:
$ sudo apt-get install php5-memcached
you dont even need to install the membase server first - this can be done afterwards. hope this helps someone!
Installation
Des informations sur l'installation de ces extensions PECL peuvent être trouvées dans le chapitre du manuel intitulé Installation des extensions PECL. D'autres informations comme les notes sur les nouvelles versions, les téléchargements, les sources des fichiers, les informations concernant les mainteneurs ainsi qu'un CHANGELOG, peuvent être trouvées ici : » http://pecl.php.net/package/memcached
Si libmemcached est installé dans un dossier non-standard, utilisez l'option --with-libmemcached-dir=DIR , où DIR est le préfixe d'installation libmemcached. Ce dossier doit contenir le fichier include/libmemcached/memcached.h.
Zlib est nécessaire pour le support de la compression. Pour spécifier un dossier d'installation non-standard de Zlib, utilisez la directive --with-zlib-dir=DIR , où DIR est le préfixe d'installation.
Le support du gestionnaire de sessions est activé par défaut. Pour le désactiver, utilisez --disable-memcached-session .
Le support de l'authentification SASL est désactivé par défaut. Pour l'activer, utilisez l'option de compilation --enable-memcached-sasl . Ceci nécessite l'installation préalable de la bibliothèque libsasl2 ainsi que la compilation de libmemcached avec l'activation du support SASL.
Do not lose your time to install it on Ubuntu just trying "sudo apt-get install php5-memcached". There is something you need to do that sure installing memcached. Anyway...
Step 1.
$ sudo apt-get install memcached
Step 2.
$ sudo apt-get install php5-memcached
Step 3.
$ sudo /etc/init.d/apache2 restart
Ready!
What about some test?
<?php
error_reporting(E_ALL & ~E_NOTICE);
$mc = new Memcached();
$mc->addServer("localhost", 11211);
$mc->set("foo", "Hello!");
$mc->set("bar", "Memcached...");
$arr = array(
$mc->get("foo"),
$mc->get("bar")
);
var_dump($arr);
?>
Hoping to help someone.
~Kerem
At present memcached-1.0.0 does not compile with libmemcached-0.38. This is apparently due to libmemcached chaning the API.
For evidence, see this bug: http://pecl.php.net/bugs/bug.php?id=17070
Note: I am encountering the same 'memcached_st' has no member named 'hash' error on a Debian lenny amd_64 box.
If your server has --enable-json=shared as mine did, this extension requires you to have extension=json.so to load properly.
memcached 1.0.1 will compile against libmemcached 0.34.
Due to bug http://pecl.php.net/bugs/bug.php?id=17395
memcached 1.0.2 requires libmemcached 0.39+ instead.
