1

How to install redis server in CentOS 6 that installed DirectAdmin in it? Did test several methods but no success!

I want use Redis for Magento Cache

sIiiS
  • 195
  • 1
  • 1
  • 11
  • Have you installed a gcc toolchain? Redis' `make` is normally the way to go (and very easy), see the README in the tar. – Tw Bert Apr 03 '14 at 15:47
  • Yes installed , also redis installed as well with my last try, will update my Q tomorrow – sIiiS Apr 03 '14 at 21:38
  • OK. Please describe what's wrong, logs etcetera, otherwise ppl can't help out. – Tw Bert Apr 04 '14 at 04:07

1 Answers1

2

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.

Rem.co
  • 3,813
  • 3
  • 29
  • 37
  • very complete and informative! but pecl is not a necessary dependency, especially it is sometimes not included in directadmin custombuild packages. I suggest to change the flow to the make install flow as mentioned in the official site https://github.com/phadej/igbinary – Abby Chau Yu Hoi Jul 26 '14 at 21:54