For those confuse about the memcached extension and the memcache extension, the short story is that both of them are clients of memcached server, and the memcached extension offer more features than the memcache extension.
Memcached
- Introducción
- Instalación/Configuración
- Constantes predefinidas
- Tiempo de expiración
- Llamadas de retorno
- Soporte de sesiones
- Memcached — La clase Memcached
- Memcached::add — Añade un nuevo ítem asociado a una nueva clave
- Memcached::addByKey — Añade un ítem asociado a una nueva clave en un servidor determinado
- Memcached::addServer — Añade un servidor al conjunto de servidores
- Memcached::addServers — Añadir múltiple servidores al grupo de servidores
- Memcached::append — Añadir datos a un ítem existente
- Memcached::appendByKey — Añadir datos a un ítem existente en un servidor específico
- Memcached::cas — Comparar e intercambiar un ítem
- Memcached::casByKey — Comparar y cambiar un ítem en un servidor específico
- Memcached::__construct — Crear una instancia de Memcached
- Memcached::decrement — Decrementar de forma numérica el valor de un ítem
- Memcached::decrementByKey — Disminuir el valor del elemento numérico, almacenado en un servidor específico
- Memcached::delete — Eliminar un ítem
- Memcached::deleteByKey — Eliminar una clave de un servidor específico
- Memcached::deleteMulti — Delete multiple items
- Memcached::deleteMultiByKey — Delete multiple items from a specific server
- Memcached::fetch — Obtener el siguiente resultado
- Memcached::fetchAll — Obtener todos los resultados restantes
- Memcached::flush — Invalidar todos los ítems en la caché
- Memcached::get — Obtener un ítem
- Memcached::getAllKeys — Gets the keys stored on all the servers
- Memcached::getByKey — Obtiene un ítem de un servidor específico
- Memcached::getDelayed — Obtener varios ítems
- Memcached::getDelayedByKey — Solicitar múltiples ítems de un servidor específico
- Memcached::getMulti — Obtener múltiples ítems
- Memcached::getMultiByKey — Obtener múltiple ítems de un servidor específico
- Memcached::getOption — Obtener el valor de una opción Memcached
- Memcached::getResultCode — Devuelve el código de respuesta de la última operación
- Memcached::getResultMessage — Devolver un mensaje describiendo el resultado de la última operación
- Memcached::getServerByKey — Hacer corresponder una clave con un servidor
- Memcached::getServerList — Obtiene la lista de servidores del conjunto
- Memcached::getStats — Obtiene estadísticas de un grupo de servidores
- Memcached::getVersion — Obtiene la información de la versión del grupo de servidores
- Memcached::increment — Incrementa el valor númerico del ítem
- Memcached::incrementByKey — Increment numeric item's value, stored on a specific server
- Memcached::isPersistent — Check if a persitent connection to memcache is being used
- Memcached::isPristine — Check if the instance was recently created
- Memcached::prepend — Anteponer datos a un ítem existente
- Memcached::prependByKey — Antepone datos en un ítem existente en un servidor específico
- Memcached::quit — Cerrar las Conexiones abiertas
- Memcached::replace — Reemplaza un ítem bajo una clave ya existente
- Memcached::replaceByKey — Reemplaza un ítem bajo una clave existente en un servidor específico
- Memcached::resetServerList — Limpiar todos los servidores de la lista de servidores
- Memcached::set — Guarda un ítem
- Memcached::setByKey — Guardar un ítem en un servidor específico
- Memcached::setMulti — Guarda múltiples ítems
- Memcached::setMultiByKey — Guarda múltiple ítems en un servidor específico
- Memcached::setOption — Establece una opción Memcached
- Memcached::setOptions — Set Memcached options
- Memcached::setSaslAuthData — Set the credentials to use for authentication
- Memcached::touch — Establecer una nueva fecha de vencimiento en un elemento
- Memcached::touchByKey — Set a new expiration on an item on a specific server
joelhy ¶
2 years ago
mike at eastghost dot com ¶
1 year ago
It's Feb 2012, and I just spent half a day tracing a weird and sporadic problem back to Memcached extension (vers 1.0.2), which would randomly return SYSTEM ERROR and fail to either get or put data into unix memcached. Made one single change from Memcached extension back to Memcache extension and problem instantly vanished.
A year or three ago, I had changed from Memcache to Memcached for some other reason.
Now I'm on a mission to transcend the Memcache/Memcached fiasco. I'm going to try APC's variable cache, and if that doesn't work better than just revert to using a key:value stash collection in Mongo.
Basically, the Memcache / Memcache driver fiasco, which has been going on apparently for years now, has ruined serious use of unix memcached on PHP...unless you're huge and can afford to create your own MemcacheX driver...
davidt ¶
5 months ago
The module also supports SASL authentication, it just isn't documented sadly. You'll need to run the following code:
<?php
$m = new Memcached();
$m->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
$m->setSaslAuthData("user-1", "pass");
?>
You need to enable the "memcached.use_sasl = 1" ini option for memcached in the php.ini file.
