Setup PHP Redis Extension - charleshross/soarin GitHub Wiki

This guides assumes you have already installed a fresh copy of Debian Linux Wheezy 64bit (https://www.debian.org/distrib/netinst) on your server or virtual machine.

  • Words like this are commands to run on your server or virtual machine.
  • The 'pico' text editor used in this documentation comes with Debian and is super simple to use. To open a file just type pico [location of your file]. Use arrow keys to navigate, and in order press "[CTRL]+[X], [Y], [ENTER]" to save file changes.

To begin installing, SSH into your Linux Debian server as root.

phpRedis PHP Extension


phpRedis makes an extremely fast connection to Redis from PHP since it's all C code, blows php script based interfaces like Predis away.

Compile and Install phpRedis PHP extension


Get dependencies

apt-get install autoconf git

Move into PHP directory

cd /opt/php/

Clone phpredis git in

git clone git://github.com/nicolasff/phpredis.git

Move into phpredis folder

cd phpredis

Run PHPIZE

phpize

Run configure

./configure

Make

make && make install

Open your php.ini in a text editor

pico /opt/php/lib/php.ini

Add this line under where the extensions are:

extension=redis.so

After you have rebooted or restarted PHP your extension should now show up in phpinfo.