How to implement Redis in CodeIgniter?
<p>I get the tutorial in:</p>
<p><a href="http://yaminnoor.com/redis-codeigniter/" rel="noreferrer">http://yaminnoor.com/redis-codeigniter/</a></p>
<p><a href="https://codeigniter.com/user_guide/libraries/caching.html#redis" rel="noreferrer">https://codeigniter.com/user_guide/libraries/caching.html#redis</a></p>
<p>I try it like this:</p>
<p>Config (<code>application\config\redis.php</code>):</p>
<pre><code>defined('BASEPATH') OR exit('No direct script access allowed');

$config['socket_type'] = 'tcp'; //`tcp` or `unix`
$config['socket'] = '/var/run/redis.sock'; // in case of `unix` socket type
$config['host'] = '127.0.0.1'; //change this to match your amazon redis cluster node endpoint
$config['password'] = NULL;
$config['port'] = 6379;
$config['timeout'] = 0;
</code></pre>
<p>Controller:</p>
<pre><code>&lt;?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Redis_tes extends CI_Controller {
    public function __construct() {
        parent::__construct();

        $this-&gt;load-&gt;driver('cache', array('adapter' =&gt; 'redis', 'backup' =&gt; 'file'));
    }

    public function index() {
        // die('tes');
        if($this-&gt;cache-&gt;redis-&gt;is_supported() || $this-&gt;cache-&gt;file-&gt;is_supported()) {
            $var1 = $this-&gt;cache-&gt;get('cache_var1');
        } else {
            $cache_var1 = $this-&gt;_model_data-&gt;get_var1();
            $this-&gt;cache-&gt;save('cache_var1', $cache_var1);
        }
    }
}
?&gt;
</code></pre>
<p>I run <code>http://localhost/app_redis/redis_tes</code>, which produces the following error:</p>
<blockquote>
<p>An Error Was Encountered</p>
<p>Invalid driver requested: CI_Cache_redis</p>
</blockquote>
<p>Any solution to solve my problem?</p>