CakePHP provides various options as an application's caching engine out of the box. CakePHP's documentation is detailed and provides most of the answers we need. But it lacks the information of setting up Redis server itself in a server.

In this tutorial, we will show you how to setup Redis server in a ubuntu 16.04 machine.

Table Of Content

  1. Update APT package list
  2. Install Redis
  3. Install PHP Redis extension
  4. Connect CakePHP to Redis
  5. The End
Update APT package list

Update the APT package list by running:

Install Redis

Install Redis server on Ubuntu:

Install PHP Redis extension
Connect CakePHP to Redis

Now we have Redis running and the PHP extension is ready. We can connect our CakePHP application to the Redis server by providing the configuration setting at https://book.cakephp.org/3.0/en/core-libraries/caching.html#redisengine-options.

End

Redis is an in-memory cache engine, so it is blazing fast. Hope you find this tutorial helpful.