Assuming you have already installed redis
, it is running and you are able to run rediscli MONITOR
(which should say OK
), you are probably missing the phpredis
extension.
Usually this is easy to install, but in combination with DirectAdmin it requires some additional attention:
First, install igbinary
, which will greatly improve your object serialisation experience.
pecl install igbinary igbinary-devel
should do the trick, -but- on many CentOS systems the /tmp
dir is mounted with nosuid,noexec
which will prevent phpize
from completing during the installation, because pecl
will use /tmp/pear/temp/
as the build-dir.
I fixed this by editing /etc/fstab
:
--- /dev/mapper/vg_directadmin-lv_tmp /tmp ext4 defaults,noatime,noexec,nosuid,errors=continue 1 2
+++ /dev/mapper/vg_directadmin-lv_tmp /tmp ext4 defaults,noatime,errors=continue 1 2
and remounting /tmp
with mount -o remount /tmp
. After that pecl install igbinary igbinary-devel
should work.
Next, download and install phpredis, using the --enable-redis-igbinary
option. On my DirectAdmin installation the CLI php
version as a different path than the one from DirectAdmin, so we'll explicitly use the DirectAdmin version which lives in /usr/local/php5/
:
cd /tmp
wget https://github.com/nicolasff/phpredis/tarball/0ae592b
tar xzvf 0ae592b
cd nicolasff-phpredis-0ae592b/
/usr/local/php5/bin/phpize
./configure --enable-redis-igbinary --with-php-config=/usr/local/php5/bin/php-config
make
make install
After that, your extension should be installed under /usr/local/php5/lib/php/extensions/
.
Last thing that remains is to edit /usr/local/etc/php5/cgi/php.ini
and add your new extensions to be loaded. Add:
extension=igbinary.so
extension=redis.so
Restart apache afterwards, and you should be done.