Install Redis on server Source
sudo yum install epel-release
sudo yum --enablerepo=remi install redis
sudo systemctl enable redis
sudo systemctl start redis
sudo systemctl status redis
redis-cli ping
Install Redis PHP Extention Source
sudo yum -y install php-devel
sudo yum -y install git
cd /tmp
git clone git://github.com/nicolasff/phpredis.git
cd phpredis
phpize
./configure
make
make test
sudo -s make install
get your php.ini
file path
php --ini
add extension=redis.so
to php.ini
file
if get redis connection exception permission denied
Error do below commands Source
The socket must be accessible for www-data. You first have to change the chmod of the socket to 770 that the redis group can access it, make changes in /etc/redis/redis.conf
:
unixsocketperm 770
and then add www-data
to the redis group in /etc/group
:
redis:x:110:www-data