2.13.3.3. Setting up Memcache in Bitrix
Bitrix: Site Management 17.5.7
To enable support Memcache in Bitrix:
- 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
insteadofexample
indicate hosting account namein which the site is hosted. - 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
insteadofexample
indicate hosting account namein which the site is hosted. - Open the site admin panel.
- Go to section "Administration → Settings → Performance → Performance panel" and in the tab "Bitrix (optimal)" check if Memcache is activated.
- Check the site is working.