LINUX安装PHP-Rdies扩展

1. 下载phpredis
wget http://pecl.php.net/get/redis-3.1.0.tgz
2. 安装redis
tar xzf redis-3.1.0.tgz
cd redis-3.1.0
3.查看phpizephp-config路径
which phpize

   {start

      使用phpize可能会报错

      php编译扩展库时报错:Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF    environment variable. Then, rerun this script.

    解决方案:

  1. yum install m4
  2. yum -y install autoconf
    end}
which php-config
4.在当前⽬录下⽣成configure配置⽂件;运⾏下⾯两个命令,将下⾯红⾊路径换成⾃⼰的
/usr/bin/phpize (sudo apt-get install php7.0-dev)
./configure --with-php-config=/usr/bin/php-config
5.编译 安装
make && make install (/usr/lib/php/20151012/)
6.最后在php.ini加载phpredis扩展
extension=redis.so
7.重启phpnginx
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章