Instalación

Se puede encontrar información para la instalación de esta extensión PECL en el capítulo del manual titulado Instalación de extensiones PECL. Se puede encontrar información adicional, tal como nuevos lanzamientos, descargas, ficheros fuente, información de mantenimiento, y un CHANGELOG, aquí: » https://pecl.php.net/package/memcached.

Si libmemcached está instalada en una ubicación no estándar, use la opción --with-libmemcached-dir=DIR, siendo DIR el prefijo de instalación de libmemcached. Este directorio debe contener el fichero include/libmemcached/memcached.h.

Se requiere Zlib para el soporte de compresión. Para especificar una instalación no estándar de Zlib, use la opción --with-zlib-dir=DIR siendo DIR el prefijo de instalación de Zlib.

El soporte para el controlador de sesiones está activado de manera predeterminada. Para desactivarlo, use la opción --disable-memcached-session.

El soporte para la autenticación SASL está deshabilitado de forma predeterminada. Para habilitarlo, use la opción --enable-memcached-sasl. Esto requiere que haya sido instalada libsasl2 y que libmemcached haya sido construida con el soporte para SASL habilitado.

add a note

User Contributed Notes 5 notes

up
99
qeremy [at] gmail [dot] com
12 years ago
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
up
11
info at kgsw dot de
4 years ago
For PHP 7 seems to work:

$ sudo apt-get install memcached
$ sudo apt-get install php-memcached
$ sudo apachectl graceful

## php 7.2.19 / ubuntu 18.04.1

$mc = new Memcached();
$mc->addServer("localhost", 11211);
...
up
6
petermiller1986 att gmail dotttttttt com
12 years ago
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!
up
0
Clint Priest
14 years ago
If your server has --enable-json=shared as mine did, this extension requires you to have extension=json.so to load properly.
up
-14
gpuk at dasserver dot com
14 years ago
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.
To Top