PECL 的全稱是 The PHP Extension Community Library ,是一個開放的並經過 PEAR(PHP Extension and Application Repository,PHP 擴展和應用倉庫)打包格式來打包安裝的 PHP擴展庫倉庫。經過 PEAR 的 Package Manager 的安裝管理方式,能夠對 PECL 模塊進行下載和安裝。php
[root@chy ~]# cd /usr/local/src/ [root@chy src]# wget https://codeload.github.com/phpredis/phpredis/zip/develop (首先下載一個develop包) [root@chy src]# du -sh develop 220K develop [root@chy src]# mv develop phpredis-develop.zip (將這個develop更名字) [root@chy src]# unzip phpredis-develop.zip [root@chy src]# cd phpredis-develop [root@chy phpredis-develop]# [root@chy phpredis-develop]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. (這裏報錯少autoconf) [root@chy phpredis-develop]# yum install -y autoconf (安裝此包) [root@chy phpredis-develop]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 (生成configure文件) [root@chy phpredis-develop]# ./configure --with-php-config=/usr/local/php/bin/php-config (編譯) [root@chy phpredis-develop]# echo $? 0 (成功) [root@chy phpredis-develop]# make &&make install [root@chy phpredis-develop]# ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ opcache.so redis.so (redis.so這個是擴展模塊) [root@chy phpredis-develop]# /usr/local/php/bin/php -m |grep redis (並無找到此模塊) [root@chy phpredis-develop]# /usr/local/php/bin/php -i |grep extension_dir extension_dir => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 sqlite3.extension_dir => no value => no value (查看擴展模塊存放目錄,咱們能夠在php.ini中去自定義該路徑) [root@chy phpredis-develop]# vi /usr/local/php/etc/php.ini ;extension=php_shmop.dll extension = redis.so (增長extension = redis.so 這個能夠在最後加也能夠在;extension=php_shmop.dll這個的後面增長) [root@chy phpredis-develop]# /usr/local/php/bin/php -m |grep redis redis (查看已經增長了此模塊)