Install Redis extension for local PHP 7 on Mac

This guide assumes that you have php cli installed and you have php version > 7.

To check your PHP version:

⚡ php -v
PHP 7.1.1 (cli) (built: Feb 13 2017 10:05:49) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.1, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans

Installation

cd /tmp

wget https://github.com/phpredis/phpredis/a
rchive/php7.zip -O phpredis.zip

unzip -o /tmp/phpredis.zip && mv /tmp/phpredis-* /tmp/phpredis && cd /tmp/phpredis && phpize && ./configure && make && sudo make install

Now check your php.ini location using the command:

⚡ php -i | grep php.ini

you’ll get output like:

/your/path/to/php.ini

run the following command:

sudo echo "extension=redis.so" >> /your/path/to/php.ini

To check if you have redis extension loaded, run the command:

⚡ php -i | grep Redis
Redis Support => enabled
Redis Version => 3.0.0-rc1
Total Views: 21 ,