{"id":4154,"date":"2019-11-20T11:27:04","date_gmt":"2019-11-20T10:27:04","guid":{"rendered":"https:\/\/www.combell.com\/en\/help\/?post_type=ht_kb&#038;p=4154"},"modified":"2023-02-07T14:41:02","modified_gmt":"2023-02-07T13:41:02","slug":"how-to-implement-redis-in-drupal-7","status":"publish","type":"ht_kb","link":"https:\/\/www.combell.com\/en\/help\/kb\/how-to-implement-redis-in-drupal-7\/","title":{"rendered":"How to implement Redis in Drupal 7?"},"content":{"rendered":"    \t\t<div class=\"hts-messages hts-messages--info   hts-messages--withicon \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tHINT: If you have a CMS hosting account (WordPress Performance, Magento Business, Joomla Express, Drupal Express, etc.), Combell will automatically choose the best caching method for you and configure it. You do not need to go through this procedure.    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n    \t\t<div class=\"hts-messages hts-messages--alert   hts-messages--withicon \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tATTENTION: This tutorial can NOT be combined with an implementation of Memcached in Drupal 7    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n<p><strong>To implement Redis as easily as possible in Drupal 7, proceed as follows:<\/strong><\/p>\n<ol>\n<li>First make sure you <a href=\"https:\/\/www.combell.com\/en\/help\/kb\/activate-caching-on-your-webhosting\/\">Activate Redis caching <\/a>from <a href=\"https:\/\/my.combell.com\/en\" target=\"_blank\" rel=\"noopener\">the control panel<\/a><\/li>\n<li>Login in the backend. This can be done by generating a single sign-on link via drush.\n<pre><code>drush uli -l ninefortwo.be\n<\/code><\/pre>\n<p>You type this in the root directory of the Drupal installation. Here you get a link that looks approximately like this:<\/p>\n<pre><code>https:\/\/ninefortwo.be\/user\/reset\/1\/1456307446\/R022fU2OH1QEopq7PsxBXKzgk92Op0kfV_yKIXeY1EU\/login\n<\/code><\/pre>\n<p>Please note that this link is valid only once. If you logged out, you will have to generate a new link.<\/li>\n<li>Install the &#8220;Redis&#8221; module\n<ol>\n<li>Once logged in, go to &#8220;Modules&#8221; =&gt; &#8220;Install new module&#8221;.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3469\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/11\/How-to-implement-Redis-in-Drupal-72-300x15.png\" alt=\"\" width=\"300\" height=\"15\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3470\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/11\/How-to-implement-Redis-in-Drupal-73.png\" alt=\"\" width=\"202\" height=\"43\"><\/li>\n<li>Go to https:\/\/www.drupal.org\/project\/redis and please copy the link of the zip file of the latest release of Drupal 7.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3471\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/11\/How-to-implement-Redis-in-Drupal-74-300x28.png\" alt=\"\" width=\"300\" height=\"28\"><\/li>\n<li>Then go back and paste this URL into the text field &#8220;Install from a URL&#8221; and click &#8220;Install&#8221;<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3472\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/11\/How-to-implement-Redis-in-Drupal-75-300x192.png\" alt=\"\" width=\"300\" height=\"192\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3473\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/11\/How-to-implement-Redis-in-Drupal-76-300x48.png\" alt=\"\" width=\"300\" height=\"48\"><\/li>\n<\/ol>\n<\/li>\n<li>Activate the module\n<ol>\n<li>Click &#8220;Modules&#8221; in the backend of Drupal. Now search for &#8220;Redis&#8221; from the list of modules.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3474\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/11\/How-to-implement-Redis-in-Drupal-77-300x15.png\" alt=\"\" width=\"300\" height=\"15\"><\/li>\n<li>Now switch on the &#8220;Redis&#8221; module and click &#8220;Save settings&#8221; (button on the left bottom)<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3475\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/11\/How-to-implement-Redis-in-Drupal-78-300x39.png\" alt=\"\" width=\"300\" height=\"39\"><\/li>\n<\/ol>\n<\/li>\n<li>Adjusting the configuration of the Redis module<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3476\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/11\/How-to-implement-Redis-in-Drupal-79.png\" alt=\"\" width=\"121\" height=\"107\">\n<ol>\n<li>Change to the sites\/default\/ directory.<\/li>\n<li>Add the following to the bottom of the file settings.php:\n<pre><code>\/* Redis config\n * Please leave the settings below untouched\n *\/\n  $conf['cache_backends'][]            = 'sites\/all\/modules\/redis\/redis.autoload.inc';\n  $conf['cache_class_cache']           = 'Redis_Cache';\n  $conf['cache_class_cache_menu']      = 'Redis_Cache';\n  $conf['cache_class_cache_bootstrap'] = 'Redis_Cache';\n  $conf['lock_inc'] = 'sites\/all\/modules\/redis\/redis.lock.inc';\n  $conf['path_inc'] = 'sites\/all\/modules\/redis\/redis.path.inc';\n  $conf['redis_client_host'] = \u2018250.250.250.1';\n  $conf['redis_client_port'] = 10000;\n  $conf['redis_client_password'] = \"XD23SggF\";\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>Here you need to replace the IP address, port and password, of course, by the Redis IP, port number and password.<\/li>\n<\/ol>\n<h3 id=\"checkingredis\">Checking Redis<\/h3>\n<p>Then check if the Redis Cache is being correctly filled. This is done as follows via the Redis-CLI:<\/p>\n<p>Execute this command:<\/p>\n<pre><code>    redis-cli -h redisipadress -p redisportnumber\n<\/code><\/pre>\n<p>Example:<\/p>\n<pre><code>    redis-cli -h 250.250.250.1 -p 10000\n<\/code><\/pre>\n<p>This is what will appear<\/p>\n<pre><code>    250.250.250.1:10000&gt;\n<\/code><\/pre>\n<p>Now enter the word &#8220;AUTH&#8221; followed by the password of the Redis instance and press enter. This looks like this:<\/p>\n<pre><code>    250.250.250.1:10000&gt; AUTH ***************\n<\/code><\/pre>\n<p>You should now get an \u201cOK\u201d back. Respond with executing this command: \u201ckeys *\u201d like so:<\/p>\n<pre><code>    250.250.250.1:10000&gt; keys *\n<\/code><\/pre>\n<p>If Redis is configured properly, you see an output similar to the following:<\/p>\n<pre><code>1) \"zc:k:f01_B95179D8427D4CD3A6E015530E9E4\"\n2) \"zc:ti:f01_BLOCK_SLIDE2\"\n3) \"zc:k:f01_Zend_LocaleC_nl_NL_country_MR\"\n4) \"zc:ti:f01_BLOCK_CATEGORY_ABOVE_EMPTY_COLLECTION\"\n5) \"zc:k:f01_A9B2A0BB16F05FAA2371C0A5FB79E\"\n6) \"zc:k:f01_CMS_BLOCK_BLOCK_LEFT_TOP_1_1\"\n7) \"zc:k:f01_Zend_LocaleC_sv_SE_language_sv\"\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To implement Redis as easily as possible in Drupal 7, proceed as follows: First make sure you Activate Redis caching from the control panel Login in the backend. This can be done by generating a single sign-on link via drush. drush uli -l ninefortwo.be You type this in the root&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[58],"ht-kb-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/4154"}],"collection":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/comments?post=4154"}],"version-history":[{"count":1,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/4154\/revisions"}],"predecessor-version":[{"id":4155,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/4154\/revisions\/4155"}],"wp:attachment":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/media?parent=4154"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb-category?post=4154"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb-tag?post=4154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}