2.13.3.3. Setting up Memcache in Bitrix

To enable support Memcache in Bitrix:

  1. At the end of the file bitrix/php_interface/dbconn.php add code like this:
    define("BX_CACHE_TYPE", "memcache");
    define("BX_MEMCACHE_HOST", "unix:///home/example/.system/memcache/socket");
    define("BX_MEMCACHE_PORT", "0");

    In the line with the parameter BX_MEMCACHE_HOST insteadof example indicate hosting account namein which the site is hosted.

  2. In the catalog bitrix create a file .settings_extra.php with code like this:
    .settings_extra.php
    <?php
    return array(
        'cache' => array(
            'value' => array(
                'type' => 'memcache',
                'memcache' => array(
                    'host' => 'unix:///home/example/.system/memcache/socket',
                    'port' => '0'
                ),
                'sid' => $_SERVER["DOCUMENT_ROOT"]."#01"
            ),
        ),
    );
    ?>

    In the line with the parameter host insteadof example indicate hosting account namein which the site is hosted.

  3. Open the site admin panel.
  4. Go to section "Administration → Settings → Performance → Performance panel" and in the tab "Bitrix (optimal)" check if Memcache is activated.
  5. Check the site is working.
Content