This is a quick guide on how to install both the Redis PHP extension as well as the daemon via SSH Installing the
Redis daemon:
CentOS 6/RHEL 6
rpm -ivh [Hidden Content]
rpm -ivh [Hidden Content]
yum -y install redis --enablerepo=remi --disableplugin=priorities
chkconfig redis on
service redis start
CentOS 7/RHEL 7
rpm -ivh [Hidden Content]
rpm -ivh [Hidden Content]
yum -y install redis --enablerepo=remi --disableplugin=priorities
systemctl enable redis
systemctl start redis
Installing the Redis PHP extension for PHP5.5, PHP5.6 and PHP7.0.
for phpver in 55 56 70 ; do
cd ~
wget [Hidden Content]
tar -xvf redis-*.tgz
cd redis*
/opt/cpanel/ea-php$phpver/root/usr/bin/phpize
./configure --with-php-config=/opt/cpanel/ea-php$phpver/root/usr/bin/php-config
make && make install
echo 'extension=redis.so' >> /opt/cpanel/ea-php$phpver/root/etc/php.d/redis.ini
cd ~
rm -rf redis*
done
/scripts/restartsrv_httpd
/scripts/restartsrv_apache_php_fpm
All done! Check to make sure the PHP extension is loaded in each version of PHP:
for phpver in 55 56 70 ; do
echo "PHP $phpver" ; /opt/cpanel/ea-php$phpver/root/usr/bin/php -i |grep "Redis Support"
done
Output should be:
PHP 55
Redis Support => enabled
PHP 56
Redis Support => enabled
PHP 70
Redis Support => enabled
Source:
[Hidden Content]