Skip to content

Instantly share code, notes, and snippets.

@grandmanitou
Last active May 26, 2020 07:56
Show Gist options
  • Save grandmanitou/c13c70002d1cc6b8886ec6d238b85254 to your computer and use it in GitHub Desktop.
Save grandmanitou/c13c70002d1cc6b8886ec6d238b85254 to your computer and use it in GitHub Desktop.
Install Redis for PHP 7.x +

Install Redis for PHP 7.x +

Install on OSX

brew install redis

Final result

brew info redis

Gives out

redis: stable 6.0.1 (bottled), HEAD Persistent key-value database, with built-in net interface

Install PHP extension

Check your version of redis, then find a suitable version of the extension here. If unfamiliar with pecl, type pecl to see the options. Type in:

pecl install redis

Enter NO to each question asked if you're not sure.

If that succeeds check the new file it created at: /usr/local/lib/php/pecl/20180731/redis.so

The install will have added extension="redis.so" to top of your php ini. Check that by opening the file /usr/local/etc/php/7.3/php.ini. (assuming you're on 7.3 there)

brew services restart php

php -i | grep Redis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment