php redis扩展

    测试机上测试一些数据需要用到redis扩展,偷懒yum安装的php,以前yum install php-pecl-redis.x86_64可以安装扩展,这次找不到安装包,不折腾手动安装下。

1.下载phpredis

cd /usr/local/src

wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz

tar -zxvf 2.2.4.tar.gz

cd phpredis-2.2.4/

2.用phpize生成configure配置文件

/usr/bin/phpize  #会生成几个新文件,默认安装路径自定义的按照自定义路径;

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

make #编译

make install #安装

make test #测试

3.配置php支持

vim /usr/local/php/etc/php.ini #编辑配置文件,在最后一行添加以下内容

extension="redis.so"

4.

重启http加载查看phpinfo信息:

redis

Redis Supportenabled

Redis Version2.2.4

成功!


猜你喜欢

转载自blog.51cto.com/xpu2001/2122382
今日推荐