Install phpredis MAC OSX

Ankit Jain picture Ankit Jain · Aug 18, 2018 · Viewed 27k times · Source

Can anyone help me install php-redis in MAC OSX .

brew install php-redis

not working.

pecl install php-redis

also not working getting -

invalid package name/package file "php-redis".

Homebrew Error:

homebrew_error

Answer

Nanhe Kumar picture Nanhe Kumar · Oct 22, 2018
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

brew services restart [email protected]
make test

You can check working or not

php -r "if (new Redis() == true){ echo \"\r\n OK \r\n\"; }"