We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
New design
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.13.10.1.2. Setting up Memcache in DLE

DLE can work with Memcache, but there is a flaw in its scripts that does not allow specifying the Memcache address as a unix socket.

To enable support Memcache in DLE:

  1. Open the file engine/modules/functions.php and find the following code block in it:
    $mcache = false;
    if ($config['cache_type']) {
        if (function_exists('memcache_connect')) {
            $memcache_server = explode(":", $config['memcache_server']);
            $mcache = @memcache_connect($memcache_server[0], $memcache_server[1]);
            if ($mcache AND function_exists('memcache_set_compress_threshold')) {
                memcache_set_compress_threshold($mcache, 20000, 0.2);
            }
        }
    }
  2. Replace the found block of code with this one:
    $mcache = false;
    if ($config['cache_type']) {
        if (function_exists('memcache_connect')) {
            $memcache_server = explode(":", $config['memcache_server']);
            if ($memcache_server[0] == 'unix') {
                $memcache_server = array($config['memcache_server'], 0);
            }
            $mcache = @memcache_connect($memcache_server[0], $memcache_server[1]);
            if ($mcache AND function_exists('memcache_set_compress_threshold')) {
                memcache_set_compress_threshold($mcache, 20000, 0.2);
            }
        }
    }
  3. Open the site admin panel.
  4. Go to the section "System Setup → Optimization».
  5. In field "Data for connecting to the Memcache server»Specify unix:///home/example/.system/memcache/socketsubstituting instead example hosting account namein which the site is hosted.
  6. Save your changes.
  7. Check the site is working.