Answer the question
In order to leave comments, you need to log in
Why doesn't memcached caching work in Bitrix on TimeWeb hosting?
The site is hosted by TimeWeb.
To set up memcached caching, I used this instruction.
Through the verification script, you can see that memcached is working:
<?php
if (!class_exists("Memcache")) exit("Memcached не установлен");
$memcache = new Memcache;
$memcache->connect('localhost', 11211) or exit("Невозможно подключиться к серверу Memcached");
$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>\n";
$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;
$memcache->set('key', $tmp_object, false, 10) or die ("Не получилось оставить запись в Memcached");
echo "Записываем данные в кеш Memcached (данные будут храниться 10 секунд)<br/>\n";
$get_result = $memcache->get('key');
echo "Данные, записанные в Memcached:<br/>\n";
var_dump($get_result);
?>
Server's version: 1.4.14
Write data to Memcached cache (data will be stored for 10 seconds)
Data written to Memcached:
object(stdClass)#3 (2) { ["str_attr"]=> string(4) "test" [" int_attr"]=> int(123) }
'cache' => array(
'value' => array(
'type' => array(
'class_name' => '\\Bitrix\\Main\\Data\\CacheEngineMemcache',
'extension' => 'memcache'
),
'memcache' => array(
'host' => '127.0.0.1',
'port' => '11211',
)
),
'sid' => $_SERVER["DOCUMENT_ROOT"]."#login"
),
Answer the question
In order to leave comments, you need to log in
memcache is a third-party daemon (service) that is associated with the site no more than mysql
has its own settings, ports, etc., not to mention its presence at all.
it is strange to expect a working third-party daemon from hosting, and even one configured as in Bitrix mana.
Try another hosting.
For several years I tried to get normal work from TimeWeb, as a result, patience snapped - they switched to their own server.
The number of problems has dropped to zero.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question