PECL库是一个PHP扩展库,提供了所有已知扩展和托管设备的目录,供下载PHP扩展。可以在这里找到许多PHP扩展。1、PHPRedis下载下载地址:http://pecl.php.net/package/r...[root@localhost~]#wgethttp://pecl.php.net/get/redis-3.1.0。tgz2.解压安装进入Redis目录[root@localhost~]#tarzxfredis-3.1.0.tgz[root@localhost~]#cdredis-3.1.03.在Redis文件夹下生成configure配置文件[root@localhostredis-3.1.0]#/usr/local/php/bin/phpizeConfiguringfor:PHPApiVersion:20160303ZendModuleApiNo:20160303ZendExtensionApiNo:320160303[root@localhostredis-3.1.0]#。/configure--with-php-config=/usr/local/php/bin/php-config[root@localhostredis-3.1.0]#make&&makeinstallredis.so扩展存储在/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/目录。4.在PHP配置文件php.ini中加载Redis扩展extension=redis.so5.重启服务器(Apache或Nginx)[root@localhostredis-3.1.0]#servicehttpdrestartor[root@localhostredis-3.1.0]#servicenginxstart6.测试浏览器访问index.php文件,输出phpinfo信息。如果有Redis信息,则安装成功。7、其他windows下安装Redis扩展更简单。找到对应版本下载dll文件,放到PHP目录下ext,修改PHP配置文件php.ini,加载extension=php_redis.dll,重启Apache或Nginx,查看phpinfo中是否有Redis,如果有所以,安装成功。相关链接:Redis主从配置(三)Redis集群搭建及简单使用(四)Redis持久化(五)
