pecl安装redis扩展

搜索redis

./pecl search redis
Retrieving data...0%
Matched packages, channel pecl.php.net:
========================================
Package Stable/(Latest) Local
redis   4.3.0 (stable)  4.3.0 PHP extension for interfacing with Redis

安装redis

./pecl install redis
.
.
.
Build process completed successfully
Installing '/Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/redis.so'
install ok: channel://pecl.php.net/redis-4.3.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=redis.so" to php.ini

最后在 php.ini 里配置使用扩展 extension=redis.so

如果出现

Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

则需要安装autoconf

brew install autoconf # MacOS
yum install autoconf # CentOS
apt-get install autoconf # Ubuntu

再安装redis

发布了10 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/noobman/article/details/90726061