搜索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