Установка
Это расширение » PECL не поставляется вместе с PHP. Дополнительная информация, такая как новый версии, скачивание, исходные файлы, информация о разработчике и CHANGELOG, могут быть найдены здесь: » http://pecl.php.net/package/memcache.
In order to use these functions you must compile PHP with Memcache support by using the --enable-memcache[=DIR] option. You may optionally disable memcache session handler support by specifying --disable-memcache-session.
Windows users will enable php_memcache.dll inside of php.ini in order to use these functions. Вы можете скачать DLL этого расширения PECL со страницы » PHP Downloads или » http://snaps.php.net/.
Коментарии
It is very important to note when reading the information supplied by others on this page that there are two *distinct* memcache PHP implementations for the service "memcached".
1) pecl-memcache
2) pecl-memcached
This page is for the first, pecl-memcache.
If you are looking for pecl-memcached information, visit here:
book.memcached
On Slackware, after copilling it, you should copy the file /module/memcache.so to /usr/lib/httpd/modules. Then, the instruction extension=memcache.so must be added into the file /etc/httpd/php.ini
Restart the httpd and it should work!
I hope this will help someone,
Context: I wanted to use memcache
like this:
$memcache = new \Memcache();
but composer suggests me to install the extension
"ext-memcache": "*",
but that one didn't want to work, so I installed
sudo apt install php7.4-memcache
sudo apt install php7.4-memcached
and all worked