1.安装步骤如下:
redis压缩包下载连接:https://github.com/nicolasff/phpredis
# unzip phpredis-master.zip
# cd phpredis-master/
#phpize
如果这边出现Can't find PHP headers in /usr/include/php The php-devel package is required for use of this command. ,可以通过yum install php-devel 解决
#./configure
#make && make instal。
编译的时候出现个错误:checking for igbinary includes... configure: error: Cannot find igbinary.hgoole搜索了下找到解决办法,安装下igbinary
2.安装igbinary
wget http://pecl.php.net/get/igbinary-1.1.1.tgz
tar -xzvf igbinary-1.1.1.tgz
cd igbinary-1.1.1
phpize
./configure # No need for extra config params
make
make install
安装完成之后就会在 php/modules/ 目录下面发现
igbinary.so 文件。
这时候需要在php.ini 文件中把库文件引入:
增加:
extension=igbinary.so
重起下ngix
nginx -s reload
就会在输出的phpinfo中看到。
3.重新编译下redis,然后安装。
安装好之后,还要在php.ini 引入库文件。
增加如下:
extension=redis.so
重起下nginx,在输出的phpinfo中可以看到redis选项就说明安装redis扩展成功!!
参考连接如下:
https://github.com/nicolasff/phpredis
http://stackoverflow.com/questions/14904865/memcached-igbinary-support