Answer the question
In order to leave comments, you need to log in
How to connect memcached (memcache) in Wordpress?
Debian 10, php7.4, memcache, memcached, unix socket.
How to connect memcached to wordpress?
QueryMonitor reports:
PHP Memcache extension installed but not used by WordPress
PHP Memcached extension installed but not used by WordPress
What was done:
<?php
$memcache_obj = new Memcache;
$memcache_obj->addServer('unix:///var/run/memcached/memcached.sock',0);
$status = $memcache_obj->getStats();
$MBUsed= (real)$status["bytes"]/(1024*1024);
$MBSize=(real) $status["limit_maxbytes"]/(1024*1024);
?>
Статистика Memcache:
<table border='1'>
<tr><td>Версия Memcache сервера</td><td> <?=$status ["version"];?></td></tr>
<tr><td>Время работы Memcache (в секундах) </td><td><?=$status ["uptime"];?></td></tr>
<tr><td>Максимальный объем памяти для Memcache</td><td><?=$MBSize;?> Мб</td></tr>
<tr><td>Используется памяти</td><td><? printf("%.2f",$MBUsed);?> Мб</td></tr>
</table>
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question