How to Install PHP Redis on Ubuntu 14.04 LTS

Previously, I had shown you how to install PHP Redis from source but things changed with the latest Ubuntu LTS release. Now you can install the phpredis extension from the Ubuntu respositories.

First, if you don’t have it installed already, let’s install Redis:

sudo apt-get install redis-server

After we get Redis installed (and/or verified that it was installed), we can install the PHP module for Redis:

sudo apt-get install php5-redis

After the module is done installing, you will want to restart your webserver and/or process manager (php-fpm, spawncgi, et cetera). Once you’ve restarted, you can check phpinfo() for a new section labeled Redis.

In addition to the Redis interface, you will also gain the ability to use Redis as a save handler. For more information you can check out my post on using Redis as a PHP Session Handler.

Josh Sherman - The Man, The Myth, The Avatar

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.


If you found this article helpful, please consider buying me a coffee.