{"id":17232,"date":"2025-01-16T10:08:18","date_gmt":"2025-01-16T15:08:18","guid":{"rendered":"https:\/\/kb.n0c.com\/?post_type=ht_kb&#038;p=17232"},"modified":"2026-10-21T20:43:35","modified_gmt":"2026-10-22T00:43:35","slug":"how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache","status":"publish","type":"ht_kb","link":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/","title":{"rendered":"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache"},"content":{"rendered":"\n<p>In this article, we will look at how to activate Memcached or Redis on Drupal with LiteSpeed Cache.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><strong>Note<\/strong>: The <a href=\"https:\/\/kb.n0c.com\/en\/glossary\/\">glossary<\/a> contains explanations on a wide range of subjects and can be consulted to clarify certain terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Make sure <strong>Composer<\/strong> is installed (if needed, please refer to <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/install-composer-and-phpmailer-on-n0c\/#:~:text=clarify%20certain%20terms.-,Step%201%3A%20Installation%20of%20Composer,-First%20of%20all\">How to install Composer and PHPMailer<\/a>).<\/p>\n\n\n\n<p>Enter the following address in your web browser: <a href=\"https:\/\/mg.n0c.com\/en\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/mg.n0c.com\/en\/<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Activate Memcached on Drupal<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Memcachedprep\">Preparations for Memcached<\/h3>\n\n\n\n<p>Before installing the Memcached module, please follow these instructions:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Activate Memcached, as explained in <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-use-memcached\/#:~:text=most%20common%20languages.-,How%20to%20Activate%20Memcached,-If%20it%20is\">How to use Memcached<\/a>. <\/li>\n\n\n\n<li>Take note of the <strong>Path<\/strong> to Linux sock to establish the link between Memcached and your web application (path \/home\/N0C_USERNAME\/.memcached\/memcached.sock), where N0C_USERNAME must be replaced by your real username:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-1024x259.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"259\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-1024x259.png\" alt=\"Path to Linux sock to establish the link between Memcached and your web application\" class=\"wp-image-17237\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-1024x259.png 1024w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-300x76.png 300w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-768x194.png 768w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-50x13.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-1536x388.png 1536w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-60x15.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-100x25.png 100w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1.png 1583w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Confirm that the <strong>Memcached<\/strong> server has been started (the <strong>Play<\/strong> button is automatically grayed out):<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_lance.png\"><img loading=\"lazy\" decoding=\"async\" width=\"241\" height=\"62\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_lance.png\" alt=\"Confirm that the Memcached server has been started\" class=\"wp-image-17220\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_lance.png 241w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_lance-50x13.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_lance-60x15.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_lance-100x26.png 100w\" sizes=\"auto, (max-width: 241px) 100vw, 241px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Go to <strong>Languages<\/strong> -&gt; <strong>PHP<\/strong>, and activate the MEMCACHE and MEMCACHED extensions, as explained in <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/php\/#:~:text=the%20change%20made%3A-,How%20to%20Enable%20or%20Disable%20the%20PHP%20Extensions,-Most%20of%20the\">How to use the PHP interface<\/a>: <\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_drupal_extensions-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"559\" height=\"195\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_drupal_extensions-1.png\" alt=\"activate the MEMCACHE and MEMCACHED extensions\" class=\"wp-image-17191\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_drupal_extensions-1.png 559w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_drupal_extensions-1-300x105.png 300w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_drupal_extensions-1-50x17.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_drupal_extensions-1-60x21.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_drupal_extensions-1-100x35.png 100w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>Please refer to the article <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-use-the-mg-panel-terminal\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Use the MG Panel Terminal<\/a> to connect to the N0C hosting  Terminal:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal.png\"><img loading=\"lazy\" decoding=\"async\" width=\"343\" height=\"182\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal.png\" alt=\"Connect to the N0C hosting terminal\" class=\"wp-image-17195\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal.png 343w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal-300x159.png 300w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal-50x27.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal-60x32.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal-100x53.png 100w\" sizes=\"auto, (max-width: 343px) 100vw, 343px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Change the directory for the Drupal installation folder (here, public_html) by typing:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>cd public_html<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installing the Memcached Module<\/h3>\n\n\n\n<p>You now need to install the Memcached module itself.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Still using the N0C hosting  Terminal and from the public_html working folder, run this command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>composer require drupal\/memcache<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>You will get an installation confirmation:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Memcache.png\"><img loading=\"lazy\" decoding=\"async\" width=\"546\" height=\"272\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Memcache.png\" alt=\"Installing the Memcached Module\" class=\"wp-image-17202\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Memcache.png 546w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Memcache-300x149.png 300w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Memcache-50x25.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Memcache-60x30.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Memcache-100x50.png 100w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/a><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Activating the Memcached Module<\/h3>\n\n\n\n<p>Once you have installed the Memcached module, you need to activate it.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log on to Drupal administration at https:\/\/yoursite\/admin, where <strong>yoursite<\/strong> is the name of your website.<\/li>\n\n\n\n<li>Once in the admin interface, go to <strong>Manage<\/strong> -&gt; <strong>Extend<\/strong> and check <strong>Memcache<\/strong>:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Memcached-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"561\" height=\"621\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Memcached-2.png\" alt=\"Activating the Memcached Module\" class=\"wp-image-17206\" style=\"width:415px;height:auto\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Memcached-2.png 561w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Memcached-2-271x300.png 271w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Memcached-2-45x50.png 45w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Memcached-2-54x60.png 54w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Memcached-2-90x100.png 90w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>At the bottom of the page, click on the <strong>Install<\/strong> button.<\/li>\n\n\n\n<li>If the installation is successful, Drupal will return a notification of success.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring Memcache in Drupal<\/h3>\n\n\n\n<p>Once the Memcache module has been activated, you need to configure it in Drupal.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Using N0C&#8217;s  Terminal or file editor, open the file sites\/default\/settings.php and put the following code at the end of the file (the code contains the socket path, which must be replaced by the path to the Linux socket noted in the <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/#Memcachedprep:~:text=Preparations%20for%20Memcached\">Preparations for Memcached<\/a>):<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$settings&#91;'cache']&#91;'default'] = 'cache.backend.memcache';\/\/ Use UNIX socket instead of IP address and port\n$settings&#91;'memcache']&#91;'servers'] = &#91;'unix:\/\/\/home\/N0C_USERNAME\/.memcached\/memcached.sock'=&gt; '0']; \/\/ Replace with your socket path and use port '0'\/\/ Configure cache bins\n$settings&#91;'memcache']&#91;'bins'] = &#91;'default' =&gt; 'default','cache' =&gt; 'cache','config' =&gt; 'config','data' =&gt; 'data',];\/\/ Key prefix to avoid conflicts\n$settings&#91;'memcache']&#91;'key_prefix'] = 'drupal_';<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>In the  Terminal of the Web Project, check that the cache is working properly by doing a clear cache :<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;quuwmcjj@hc-probear-staging public_html]$  .\/vendor\/bin\/drush cache:clear\n\n Choose a cache to clear &#91;render]:\n  &#91;0] drush\n  &#91;1] theme-registry\n  &#91;2] router\n  &#91;3] css-js\n  &#91;4] render\n  &#91;5] plugin\n  &#91;6] bin\n  &#91;7] container\n  &#91;8] views\n &gt; 0\n\n &#91;success] 'drush' cache was cleared.\n&#91;quuwmcjj@hc-probear-staging public_html]$ <\/code><\/pre>\n\n\n\n<p>This completes the activation of Memcached for Drupal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to activate Redis on Drupal<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"PrepRedis\">Preparations for Redis<\/h3>\n\n\n\n<p>Before installing the Redis module, please follow these instructions.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Activate Redis, as explained in <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-use-redis\/#:~:text=client%2Dcreated%20application.-,How%20to%20Activate%20Redis,-If%20it%20is\">How to use Redis<\/a>.<\/li>\n\n\n\n<li>Take note of the <strong>Path<\/strong> to Linux sock to establish the link between Redis and your web application (path \/home\/N0C_USERNAME\/.redis\/redis.sock), where N0C_USERNAME must be replaced by your real username:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-1024x330.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"330\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-1024x330.png\" alt=\"Path to Linux sock to establish the link between Redis and your web application\" class=\"wp-image-16868\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-1024x330.png 1024w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-300x97.png 300w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-768x247.png 768w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-50x16.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-1536x495.png 1536w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-60x19.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN-100x32.png 100w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2024\/11\/Redis_chemin_EN.png 1617w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Confirm that the <strong>Redis<\/strong> server has been started (the <strong>Play<\/strong> button is automatically grayed out) :<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Redis_lance.png\"><img loading=\"lazy\" decoding=\"async\" width=\"241\" height=\"62\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Redis_lance.png\" alt=\"Confirm that the Redis server has been started\" class=\"wp-image-17223\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Redis_lance.png 241w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Redis_lance-50x13.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Redis_lance-60x15.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Redis_lance-100x26.png 100w\" sizes=\"auto, (max-width: 241px) 100vw, 241px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Go to <strong>Languages<\/strong> -&gt; <strong>PHP<\/strong>, and activate the REDIS extension:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Choix_Redis_Drupal.png\"><img loading=\"lazy\" decoding=\"async\" width=\"187\" height=\"133\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Choix_Redis_Drupal.png\" alt=\"activate the REDIS extension\" class=\"wp-image-17209\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Choix_Redis_Drupal.png 187w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Choix_Redis_Drupal-50x36.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Choix_Redis_Drupal-60x43.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Choix_Redis_Drupal-100x71.png 100w\" sizes=\"auto, (max-width: 187px) 100vw, 187px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>Please refer to the article <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-use-the-mg-panel-terminal\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Use the MG Panel Terminal<\/a> to connect to the N0C hosting  Terminal:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal.png\"><img loading=\"lazy\" decoding=\"async\" width=\"343\" height=\"182\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal.png\" alt=\"Connect to the N0C terminal\" class=\"wp-image-17195\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal.png 343w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal-300x159.png 300w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal-50x27.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal-60x32.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_Drupal_Terminal-100x53.png 100w\" sizes=\"auto, (max-width: 343px) 100vw, 343px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Change the directory for the Drupal installation folder (here, public_html) by typing:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>cd public_html<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installing the Redis module<\/h3>\n\n\n\n<p>Now you need to install the Redis module itself.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Still using the N0C hosting  Terminal and from the public_html working folder, run this command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>composer require drupal\/redis<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>You will receive a confirmation of installation:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Redis.png\"><img loading=\"lazy\" decoding=\"async\" width=\"621\" height=\"318\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Redis.png\" alt=\"confirmation of installation\" class=\"wp-image-17211\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Redis.png 621w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Redis-300x154.png 300w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Redis-50x26.png 50w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Redis-60x31.png 60w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Require_Drupal_Redis-100x51.png 100w\" sizes=\"auto, (max-width: 621px) 100vw, 621px\" \/><\/a><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Activating the Redis Module<\/h3>\n\n\n\n<p>After installing the Redis module, you need to activate it.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log on to Redis administration at https:\/\/yoursite\/admin, where <strong>yoursite<\/strong> is the name of your website.<\/li>\n\n\n\n<li>Once in the admin interface, go to <strong>List<\/strong> and check <strong>Redis<\/strong>:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Redis.png\"><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"890\" src=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Redis.png\" alt=\"Activating the Redis Module in N0C\" class=\"wp-image-17213\" style=\"width:553px;height:auto\" srcset=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Redis.png 670w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Redis-226x300.png 226w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Redis-38x50.png 38w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Redis-45x60.png 45w, https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Drupal_cocher_Redis-75x100.png 75w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/a><\/figure><\/div>\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Click on the <strong>Install<\/strong> button at the bottom of the page.<\/li>\n\n\n\n<li>If the installation is successful, Drupal will return a notification of success.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring Redis in Drupal<\/h3>\n\n\n\n<p>Once the Redis module has been activated, you need to configure it in Drupal.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Using the  Terminal or N0C&#8217;s file editor, open the file sites\/default\/settings.php and put the following code at the end of the file (the code contains the path to the socket, which must be replaced by the path to the Linux socket noted in the <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/#Memcachedprep:~:text=Redis%20on%20Drupal-,Preparations%20for%20Redis,-Before%20installing%20the\">Preparations for Redis<\/a>):<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Redis configuration \n$settings&#91;'redis.connection']&#91;'interface'] = 'PhpRedis'; \/\/ Make sure the PhpRedis extension is installed \n$settings&#91;'redis.connection']&#91;'host'] = '\/home\/N0C_USERNAME\/.redis\/redis.sock'; \/\/ Full path to Unix socket \n$settings&#91;'redis.connection']&#91;'port'] = 0; \/\/ Port 0 as this is a Unix socket, no need to specify a port \n$settings&#91;'redis.connection']&#91;'database'] = 0; \/\/ Specifies the Redis database to use (default 0) \/\/ Configure caching to use Redis \n$settings&#91;'cache']&#91;'default'] = 'cache.backend.redis'; \/\/ If you're using Redis for sessions, add this configuration too: $settings&#91;'session_storage'] = 'redis'; $settings&#91;'redis. session_storage']&#91;'interface'] = 'PhpRedis'; $settings&#91;'redis.session_storage']&#91;'host'] = '\/home\/quuwmcjj\/.redis\/redis.sock'; \/\/ Unix socket path $settings&#91;'redis.session_storage']&#91;'port'] = 0; \/\/ No port to specify for a Unix socket.<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>In the  Terminal of the Web Project, check that the cache is working properly by doing a clear cache:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;quuwmcjj@hc-probear-staging public_html]$  .\/vendor\/bin\/drush cache:clear\n\n Choose a cache to clear &#91;render]:\n  &#91;0] drush\n  &#91;1] theme-registry\n  &#91;2] router\n  &#91;3] css-js\n  &#91;4] render\n  &#91;5] plugin\n  &#91;6] bin\n  &#91;7] container\n  &#91;8] views\n &gt; 0\n\n &#91;success] 'drush' cache was cleared.\n&#91;quuwmcjj@hc-probear-staging public_html]$<\/code><\/pre>\n\n\n\n<p>This completes the activation of Redis for Drupal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will look at how to activate Memcached or Redis on Drupal with LiteSpeed Cache. Prerequisites Make sure Composer is installed (if needed, please refer to How to install Composer and PHPMailer). Enter the following address in your web browser: https:\/\/mg.n0c.com\/en\/. How to Activate Memcached on Drupal&#8230;<\/p>\n","protected":false},"author":4,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[379],"ht-kb-tag":[],"class_list":["post-17232","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-performances_en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Enable Memcached or Redis on Drupal with LS Cache<\/title>\n<meta name=\"description\" content=\"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache. With N0C.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable Memcached or Redis on Drupal with LS Cache\" \/>\n<meta property=\"og:description\" content=\"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache. With N0C.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/\" \/>\n<meta property=\"og:site_name\" content=\"N0C KB\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-22T00:43:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1583\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\\\/\",\"url\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\\\/\",\"name\":\"How to Enable Memcached or Redis on Drupal with LS Cache\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kb.n0c.com\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/Memcached_chemin_EN-1-1024x259.png\",\"datePublished\":\"2025-01-16T15:08:18+00:00\",\"dateModified\":\"2026-10-22T00:43:35+00:00\",\"description\":\"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache. With N0C.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\\\/#primaryimage\",\"url\":\"https:\\\/\\\/kb.n0c.com\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/Memcached_chemin_EN-1-1024x259.png\",\"contentUrl\":\"https:\\\/\\\/kb.n0c.com\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/Memcached_chemin_EN-1-1024x259.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/kb.n0c.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/#website\",\"url\":\"https:\\\/\\\/kb.n0c.com\\\/\",\"name\":\"N0C KB\",\"description\":\"Official documentation of the N0C hosting platform\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kb.n0c.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Enable Memcached or Redis on Drupal with LS Cache","description":"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache. With N0C.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable Memcached or Redis on Drupal with LS Cache","og_description":"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache. With N0C.","og_url":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/","og_site_name":"N0C KB","article_modified_time":"2026-10-22T00:43:35+00:00","og_image":[{"width":1583,"height":400,"url":"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/","url":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/","name":"How to Enable Memcached or Redis on Drupal with LS Cache","isPartOf":{"@id":"https:\/\/kb.n0c.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/#primaryimage"},"image":{"@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/#primaryimage"},"thumbnailUrl":"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-1024x259.png","datePublished":"2025-01-16T15:08:18+00:00","dateModified":"2026-10-22T00:43:35+00:00","description":"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache. With N0C.","breadcrumb":{"@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/#primaryimage","url":"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-1024x259.png","contentUrl":"https:\/\/kb.n0c.com\/wp-content\/uploads\/2025\/01\/Memcached_chemin_EN-1-1024x259.png"},{"@type":"BreadcrumbList","@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-activate-memcached-or-redis-on-drupal-with-litespeed-cache\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/kb.n0c.com\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/kb.n0c.com\/en\/knowledge-base\/"},{"@type":"ListItem","position":3,"name":"How to Enable Memcached or Redis on Drupal with LiteSpeed Cache"}]},{"@type":"WebSite","@id":"https:\/\/kb.n0c.com\/#website","url":"https:\/\/kb.n0c.com\/","name":"N0C KB","description":"Official documentation of the N0C hosting platform","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.n0c.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb\/17232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/comments?post=17232"}],"version-history":[{"count":40,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb\/17232\/revisions"}],"predecessor-version":[{"id":26881,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb\/17232\/revisions\/26881"}],"wp:attachment":[{"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/media?parent=17232"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb-category?post=17232"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=17232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}