phpmacosredisphp-7.2

Install phpredis MAC OSX


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


Solution

  • 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 php@7.2
    make test
    

    You can check working or not

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