linux下Redis与phpredis扩展安装

1【安装redis服务器】

yum install redis

2 安装 phpredis扩展

去下载 http://pecl.php.net/package/redis

tar -zxvf redis-3.1.3RC1.tgz

cd redis-3.1.3RC1/

 /usr/local/php/bin/phpize

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

make

make install

出现 >Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/

 vi /usr/local/php/etc/php.ini

查找extension_dir 放开注释并修改为 :/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/

添加redis扩展文件:extension = redis.so

重启apache服务:

service httpd restart


大功告成!

你可能感兴趣的:(Linux,Redis)