git clone git://github.com/nicolasff/phpredis.git cd ./phpredis phpize
如果报 Cannot find autoconf. Please check your autoconf installation
#brew install autoconf
./configure make make install
make install 后会出现扩展so的目录 /usr/lib/php/extensions/no-debug-non-zts-20100525/
vim /etc/php.ini
#增加如下内容
extension= /usr/lib/php/extensions/no-debug-non-zts-20100525/redis.so
运行"sudo apachectl restart" 重启apache
#查看扩展安装情况
php -m |grep redis
时间: 2024-10-30 23:58:44