Thanks to nono303 on GitHub we can run this PHP extension and memcached on Windows! This is great for a dev environment to match a production unix server. I am using PHP 8.0 with this memcache extension on a Windows 10 box with a memcached server running on localhost and it is working great.
I can't post a link but the dll for this extension is at the repo: nono303/PHP-memcache-dll
And the actual memcached server for windows is at the repo: nono303/memcached
PHP.mk документација
— Lightweight Directory Access Protocol
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Патека
book.memcache.php
Локална патека за оваа страница.
Извор
php.net/manual/en
Оригиналниот HTML се реупотребува и локално се стилизира.
Режим
Прокси + преведен приказ
Кодовите, табелите и белешките остануваат читливи во истиот тек.
Референца
book.memcache.php
— Lightweight Directory Access Protocol
Референца за `book.memcache.php` со подобрена типографија и навигација.
— Lightweight Directory Access Protocol
Вовед
Мемкеш модулот обезбедува практичен процедурален и објектно-ориентиран интерфејс до memcached, високо ефективен кеширачки демон, кој беше специјално дизајниран за намалување на оптоварувањето на базата на податоци во динамични веб апликации.
Мемкеш модулот исто така обезбедува session менаџер (memcache).
Повеќе информации за memcached може да се најдат на » http://www.memcached.org/.
- Installing/Configuring
- Претходно дефинирани константи
- Примери
- — Lightweight Directory Access Protocol — Класата LDAP\ResultEntry
- Memcache::add — Додај ставка на серверот
- Memcache::addServer — Додај memcached сервер во пул за конекции
- Memcache::close — Затвори memcached сервер конекција
- Memcache::connect — Отвори memcached сервер конекција
- Memcache::decrement — Намали вредност на ставка
- Memcache::delete — Избриши ставка од серверот
- Memcache::flush — Исчисти сите постоечки ставки на серверот
- Memcache::get — Преземи ставка од серверот
- Memcache::getExtendedStats — Земи статистики од сите сервери во пул
- Memcache::getServerStatus — Враќа статус на серверот
- Memcache::getStats — Земи статистики на серверот
- Memcache::getVersion — Врати верзија на серверот
- Memcache::increment — Зголеми вредност на ставка
- Memcache::pconnect — Отвори memcached сервер постојана конекција
- Memcache::replace — Замени вредност на постоечка ставка
- Memcache::set — Складирај податоци на серверот
- Memcache::setCompressThreshold — Овозможи автоматска компресија на големи вредности
- Memcache::setServerParams — Ги менува серверските параметри и статус во реално време
- — Класата Memcache
- memcache_debug — Вклучување/исклучување на излез за отстранување грешки
Белешки од корисници 4 белешки
rob4226 на yahoo точка com ¶
пред 4 години
габриел.мајбрун@демандмедиа.ком ¶
пред 11 години
GOTCHA: Recently I was tasked with moving from PECL memcache to PECL memcached and ran into a major problem -- memcache and memcached serialize data differently, meaning that data written with one library can't necessarily be read with the other library.
For example, If you write an object or an array with memcache, it's interpreted as an integer by memcached. If you write it with memcached, it's interpreted as a string by memcache.
tl;dr - You can't safely switch between memcache and memcached without a either a cache flush or isolated cache environments.
<?php
$memcache = new Memcache;
$memcacheD = new Memcached;
$memcache->addServer($host);
$memcacheD->addServers($servers);
$checks = array(
123,
4542.32,
'a string',
true,
array(123, 'string'),
(object)array('key1' => 'value1'),
);
foreach ($checks as $i => $value) {
print "Checking WRITE with Memcache\n";
$key = 'cachetest' . $i;
$memcache->set($key, $value);
usleep(100);
$val = $memcache->get($key);
$valD = $memcacheD->get($key);
if ($val !== $valD) {
print "Not compatible!";
var_dump(compact('val', 'valD'));
}
print "Checking WRITE with MemcacheD\n";
$key = 'cachetest' . $i;
$memcacheD->set($key, $value);
usleep(100);
$val = $memcache->get($key);
$valD = $memcacheD->get($key);
if ($val !== $valD) {
print "Not compatible!";
var_dump(compact('val', 'valD'));
}
}
xrobau на gmail точка com ¶
пред 8 години
Note that the Memcache 3.0.8 module DOES NOT WORK WITH PHP 7 (or higher)
There is an open bug about this - see https://bugs.php.net/bug.php?id=72887 and over 1 year old at time of writing - however, it appears that development of this module has been abandoned and the MemcacheD module is now the only way to access Memcache through PHP.
If you are writing a NEW tool, and you want to use Memcache, use the MemcacheD library. If you are trying to repair an old tool, you'll either have to stick with PHP 5.6, or, spend the time reworking your code to use MemcacheD.
Лајош Вереш ¶
пред 8 години
3.0.8 is not really compatible with PHP 7, but this fork seems to be working:
https://github.com/websupport-sk/pecl-memcache
For new projects, memcacheD sounds safer, but this fork might help to keep alive some legacy projects.
Debian package manager chose this version: https://github.com/websupport-sk/pecl-memcache/commit/4991c2fff22d00dc81014cc92d2da7077ef4bc86
Based on this:
http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php-memcache/ https://packages.debian.org/sid/php/php-memcache