How to install redis extension for php 7-ThrowExceptions

Exception or error:

Referred this link https://anton.logvinenko.name/en/blog/how-to-install-redis-and-redis-php-client.html

And done following steps

PhpRedis for PHP 7 (Skip it if you have different PHP version)

Install required package

apt-get install php7.0-dev

Download PhpRedis

cd /tmp
wget https://github.com/phpredis/phpredis/archive/php7.zip -O phpredis.zip

But, https://github.com/phpredis/phpredis/archive/php7.zip file not found for installation.

How to solve:

Try to use this url https://github.com/phpredis/phpredis/archive/3.1.4.zip

wget https://github.com/phpredis/phpredis/archive/3.1.4.zip -O phpredis.zip

Answer:

Yesterday, I installed Redis on my Vagrant box (/etc/php/7.0):

  • sudo pecl install redis
  • sudo service php7.0-fpm restart

(optional: run php -m for listing the php modules).

Now, you can use the Redis class in your php code.

Answer:

I am always looking for an easy method to do things and I found a repo from ubuntu:

sudo apt-get install php-redis

After installation, You should restart the apache service.

Answer:

This GitHub is a great resource for MAMP users.

For Mac Users:

  1. Download redis.so from the appropriate subdirectory of the repo
    based on major and minor version number X.Y (following semver).
  2. Move the file to
    /Applications/MAMP/bin/php/phpX.Y.X/lib/php/extensions/no-debug-non-zts-xxxxxxxx
  3. Add extension=redis.so to the end of php.ini

Answer:

I just ran the command below for Cent os 7

yum install php-redis

Resolved my issue and i added the config in php.ini manualy

You should add “extension=redis.so” to php.ini

Leave a Reply

Your email address will not be published. Required fields are marked *