php安装 redis扩展

http://pecl.php.net/package/redis

下载需要的redis版本

//下载扩展源码包

wget http://pecl.php.net/get/redis-5.0.0.tgz

//解压

tar -zxvf redis-5.0.0.tgz

//切换目录

cd redis-5.0.0

//查找phpize,查看目录

(whereis phpize)/(which phpize)

//编译安装php扩展

/usr/local/php/bin/phpize

//查找php-config

(whereis php-config)/(which php-config)

//配置环境

./configure --with-php-config=/usr/local/php/bin/php-config

//编译

make && make install

//编译完成之后显示

Build complete.

Don't forget to run 'make test'.

//进入php.ini添加扩展

vi /use/local/php/etc/php.ini(php配置文件)

extension=redis.so

//重启nginx

/usr/local/nginx/sbin/nginx -s reload

//重启php-fpm

pkill php-fpm

/usr/local/php/sbin/php-fpm

查看redis扩展是否安装成功

/usr/local/php/bin/php(php安装路径) -m

 

 

 

 

你可能感兴趣的:(php)