centos7 php安装redis扩展

centos7 install php redis extension

下载phpredis

https://github.com/phpredis/phpredis/releases

解压phpredis

tar xzf phpredis-4.0.0.tar.gz

编译安装

cd phpredis-4.0.0/
yum install -y php56-php-devel
/opt/remi/php56/root/usr/bin/phpize
yum install -y gcc
./configure --with-php-config=/opt/remi/php56/root/usr/bin/php-config
yum install -y ntpdate
ntpdate us.pool.ntp.org
make && make install

# 修改php.ini
mkdir /root/extensions
cp redis.so /root/extensions/
extension_dir = "/root/extensions" 
extension=redis.so