Drupal Redis integration – How we do it
Wanna integrate Redis into Drupal? We can help you to set it up.
Redis is one of several Drupal-supported backend cache systems that improve Drupal website performance.
At Bobcares, we often get requests regarding drupal as part of our Server Management Services.
Today, let’s get into the details and see how our Support Engineers help our customers to integrate it.
How we integrate Redis into Drupal
Usually, Redis enhance the website performance by caching the database queries on the first visit. Also, the cached content serves the cached content to other users who load the same page, without querying the actual database.
Here, we use cPanel along with Drupal to enable Redis.
1. Initially, we log into the cPanel and go to the Software section and click on it.
2. If needed, we can change the max memory from the given page and click on the button below to start it. Also, we note the “Your Redis socket address is” field.
3. Next, we enable the Redis PHP extension via the cPanel.
4. After that, we install the Redis module via Drupal Admin area >> Extend >> + Install new module. Then we enter the URL and click Install. Else we upload the module and click Install.
5. Once the installation is completed, then we click on Enable newly added modules and enable Redis.
6. Again, we edit the Drupal settings file: ./sites/default/settings.php. Then add the below lines at the bottom of the file.
$settings['redis.connection']['host'] = '/home/USER/.kxcache/redis.sock'; $settings['redis.connection']['port'] = NULL; $settings['cache']['default'] = 'cache.backend.redis'; $settings['redis.connection']['base'] = 8;
7. Next, we clear the Drupal cache. For that we log into Drupal Admin >> Configuration >> Performance >> Clear all caches.
How we fixed the common errors
At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems while managing Drupal sites.
Now, let’s see the major reasons for this Drupal related errors and how our Support Engineers fix the top errors.
Missing PhpRedis extension
Recently, one of our customers had a problem with his Redis module. After installing the Redis module, he got an error like,
Fatal error: Class 'Redis' not found in ../drupal-8.3.7/modules/contrib/redis/src/Client/PhpRedis.php on line 16
On checking, our Support Engineers found that PhpRedis extension not installed on the server. So, we installed the PhpRedis and solved the error.
[Need assistance with drupal? We’ll help you.]
In short, one of the best ways to improve Drupal website performance is to enable Redis. Today, we saw how our Support Engineers did Drupal Redis integration and fixed errors.