为php安装redis扩展phpredis笔记

1、phpredis下载地址:http://pecl.php.net/package/redis

[jhj@localhost solf]$ wget http://pecl.php.net/get/redis-2.2.5.tgz

2、解压安装,安装方法在 https://github.com/nicolasff/phpredis/#installation

[jhj@localhost solf]$ tar xzf redis-2.2.5.tgz
[jhj@localhost solf]$ cd redis-2.2.

生成configure配置文件

[jhj@localhost redis-2.2.5]$ /usr/local/php/bin/phpize 
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

[jhj@localhost redis-2.2.5]$ ./configure --with-php-config=/usr/local/php/bin/php-config
[jhj@localhost redis-2.2.5]$ make
[jhj@localhost redis-2.2.5]$ make install
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
cp: cannot create regular file `/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/#INST@6338#': Permission denied
make: *** [install-modules] Error 1
[jhj@localhost redis-2.2.5]$ su
Password: 
[root@localhost redis-2.2.5]# make install

3、配置PHP加载扩展

extension=redis.so

4、查看phpinfo

redis

Redis Support enabled
Redis Version 2.2.5


你可能感兴趣的:(为php安装redis扩展phpredis笔记)