Skip to content

Instantly share code, notes, and snippets.

@hamidne
Created September 16, 2019 02:25
Show Gist options
  • Save hamidne/67e0fa131b9d685a2967be5b3b7243bc to your computer and use it in GitHub Desktop.
Save hamidne/67e0fa131b9d685a2967be5b3b7243bc to your computer and use it in GitHub Desktop.
Install Redis Centos 7

Install Redis on server Source

sudo yum install epel-release
sudo yum --enablerepo=remi install redis

Start Redis

sudo systemctl enable redis
sudo systemctl start redis
sudo systemctl status redis

Test Redis Working

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

Add Redis Extention to php.ini

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment