ubuntu安装php的redis扩展

下载安装扩展

首先下载包,http://pecl.php.net/package/redis

sudo aptitude install php5-dev
sudo wget http://pecl.php.net/get/redis-2.2.5.tgz
sudo tar zxf redis-2.2.5.tgz 
cd redis-2.2.5/
sudo phpize
sudo ./configure
sudo make
sudo make install

修改ini配置

sudo vim /etc/php5/fpm/conf.d/redis.ini

extension=redis.so

测试运行

sudo php5-fpm -t
sudo php5-fpm -m
sudo service php5-fpm reload