Trying to install redis extensions for php 7.0 on my high sierra apache.
brew install php-redis
- doesn't work.
brew install [email protected]
- 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?
The phpredis extension provides an API for communicating with the Redis key-value store. It is released under the PHP License, version 3.01.
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 [email protected]
run make test
.
Redis support is enable .Now you can view in phpinfo()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With