6

Trying to install redis extensions for php 7.0 on my high sierra apache.

brew install php-redis - doesn't work.

brew install php@7.0-redis - doesn't work.

brew install php70-redis - doesn't work.

google google google - Homebrew is the wrong approach, use pecl, they say.

pecl search redis shows:

redis 4.0.2 (stable) 4.0.2 PHP extension for interfacing with Redis

so pecl install redis

pecl/redis is already installed and is the same as the released version 4.0.2 install failed

hmm. that's right. And I've put in the reference to the ini file:

cat /usr/local/etc/php/7.0/conf.d/ext-redis.ini

[redis] extension="/usr/local/lib/php/pecl/20160303/redis.so"

sudo service apachectl -k restart

check phpinfo() - no mention of redis but it does state that it is loading at the ext-redis.ini file.

Definately not loading, since if I try to use it on a php page I get

Fatal error: Uncaught phpFastCache\Exceptions\phpFastCacheDriverCheckException: Redis is not installed or is misconfigured, cannot continue.

What are the steps for getting redis connected in php on macos in 2018?

frumbert
  • 2,323
  • 5
  • 30
  • 61

2 Answers2

5

I was struggling with same issue my issue is solved with bellow steps.

git clone https://www.github.com/phpredis/phpredis.git
cd phpredis
phpize && ./configure && make && sudo make install

Add extension=redis.so in your php.ini

my php.ini path is this you can find php.ini path through phpinfo();/usr/local/etc/php/7.0/php.ini restart your php

brew services restart php@7.0

run make test. Redis support is enable .Now you can view in phpinfo()enter image description here

Nanhe Kumar
  • 15,498
  • 5
  • 79
  • 71
0

You may want to use "Predis" instead of "Redis" which is an applicative client designed for people that can't make use of php "Redis" extension. However your Redis service must be running and listening for internal connections.

Geolim4
  • 454
  • 3
  • 14