redis安装 phpredis扩展

下载
www.redis.cn/download.html

安装方法当页有


安装phpredis扩展模块
http://www.redis.cn/clients.html

使用phpredis
#phpize
#./configure --enable-redis
    这里会提示configure: error: Cannot find php-config. Please use –with-php-config=PATH configure:
    是因为没有找到 php-config文件位置
    
    改为  #./configure --enable-redis --with-php-config=/usr/local/php/bin/php/php-config

#make && make install
#make test 测试

提示 The test-suite requires that proc_open() is available
proc_open()函数已经关闭.
在php.ini中找disable_functions= ***,***  中找到proc_open 并删除

下一步可以看到
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/redis.so
在php.ini中添加 redis.so
extension = "redis.so"    //注意格式,可以借鉴pdo扩展格式
重启 phpinfo()查看
Redis Support    enabled
Redis Version     2.2.5

你可能感兴趣的:(PHP,redis)