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
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章