【发布时间】:2018-11-03 02:14:01
【问题描述】:
尝试在我的 high sierra apache 上安装 php 7.0 的 redis 扩展。
brew install php-redis - 不起作用。
brew install php@7.0-redis - 不起作用。
brew install php70-redis - 不起作用。
google google google - Homebrew 是错误的方法,使用 pecl,他们说。
pecl search redis 显示:
redis 4.0.2 (stable) 4.0.2 PHP extension for interfacing with Redis
所以pecl install redis
pecl/redis is already installed and is the same as the released version 4.0.2
install failed
嗯。这是正确的。我已经输入了对ini文件的引用:
cat /usr/local/etc/php/7.0/conf.d/ext-redis.ini
[redis]
extension="/usr/local/lib/php/pecl/20160303/redis.so"
sudo 服务 apachectl -k 重启
检查 phpinfo() - 没有提到 redis,但它确实声明它正在加载 ext-redis.ini 文件。
肯定没有加载,因为如果我尝试在 php 页面上使用它,我会得到
Fatal error: Uncaught phpFastCache\Exceptions\phpFastCacheDriverCheckException: Redis is not installed or is misconfigured, cannot continue.
2018年macos上php连接redis的步骤是什么?
【问题讨论】:
-
或许可以尝试使用 Macports;
sudo port install php-redis -
我在这里做了一些解释......stackoverflow.com/a/50529784/2836621它应该以同样的方式工作
php-redis。
标签: php macos redis homebrew pecl