PHP扩展插件安装之redis.so

1、插件下载

https://github.com/phpredis/phpredis

wget https://github.com/phpredis/phpredis/archive/refs/tags/3.1.6.tar.gz

2、安装依赖包

yum install autoconf -y

3、编译插件包

tar xvf phpredis-3.1.6.tar.gz && cd phpredis-3.1.6/
/usr/local/php/bin/phpize 
./configure  --with-php-config=/usr/local/php/bin/php-config && make && make install

4、安装后,插件的位置

]# ll /usr/local/php-7.4.16/lib/php/extensions/no-debug-non-zts-20190902/
total 8780
-rwxr-xr-x 1 root root 4685614 Apr 29 00:11 opcache.a
-rwxr-xr-x 1 root root 2499952 Apr 29 00:11 opcache.so
-rwxr-xr-x 1 root root 1801312 May  1 17:21 redis.so

5、加入php.ini里面

]# vi /usr/local/php/etc/php.ini 
extension=/usr/local/php-7.4.16/lib/php/extensions/no-debug-non-zts-20190902/redis.so

6、重启php服务

systemctl restart php-fpm

 

posted @ 2023-05-01 17:35  小粉优化大师  阅读(200)  评论(0编辑  收藏  举报