从https://pecl.php.net/package/redis   里面找到自己安装的Redis对应版本的redis

1、获取已经安装的Redis版本扩展我这边安装的是4.0.1版本

wget https://pecl.php.net/get/redis-4.0.1.tgz

2、解压

 tar -zxvf redis-4.0..tgz 

3、进入目录  配置到已安装的PHP对应位置

#cd redis-4.0.
#/usr/local/php/bin/phpize
#./configure --with-php-config=/usr/local/php/bin/php-config
#make && make install

4、修改php.ini 加入redis.so(Linux不认dll文件  不要添加也不要打开)

extension="redis.so"

5、然后重启PHP和nginx

/etc/init.d/php-fpm restart
/usr/local/nginx/sbin/nginx -s reload

若出现

(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified...

修改redis.conf

daemonize no
protected-mode no

然后加载配置启动  一定要加载配置

/usr/local/redis/src/redis-server redis.conf #这个是我的目录  找到自己安装的目录  替换掉就好了

访问地址  查看phpinfo();

可以找到redis扩展  就说明安装扩展成功了

Centos 安装PHP-redis扩展的更多相关文章

  1. centos 6.5 安装php redis 扩展

    一.安装: 其中,添加PHP扩展需要用到 phpize,所以我们需要安装 php-devel 这个包. #yum install php-devel 然后编译安装phpredis: #git clon ...

  2. 在windows下安装php redis扩展

    我在本地是phpstudy集成环境,但是没有redis扩展,需要自己安装 1.先看清楚自己的php配置,在安装对应的 php_redis.dll 和 php_igbinary.dll php_redi ...

  3. lnmp环境切换php版本,并安装相应redis扩展

    ubuntu+nginx+mysql+php+redis,其中php装两个版本,php7和php56 1.让nginx支持不同站点可以选择不同的php版本 1>创建fastcgi.conf文件 ...

  4. CentOS安装php及其扩展

    列出所有的可安装的软件包 yum list | grep php56w* | grep redis 安装php及其扩展 yum install  -y php56w php56w-mysql php5 ...

  5. Mac 安装PHP Redis 扩展

    其实 Mac 安装 Redis 还是很简单,以下为个人搭建配置.注意:文章中的“*”代表任意版本号 安装 Redis 服务 安装 brew install redis 使用 # 启动 redis-se ...

  6. linux学习(三) -- lnmp环境切换php版本,并安装相应redis扩展

    原创文章,转载请注明出处   我想配置的环境是ubuntu+nginx+mysql+php+redis,其中php装两个版本,php7和php56 ubuntu+nginx+mysql+php的环境配 ...

  7. Centos 安装php Imagick 扩展

    从 centos 仓库安装 首先安装 php-pear php-devel,gcc三个软件包 yum install php-pear php-devel gcc 通过 yum 安装Centos 官方 ...

  8. centos 安装php7 memcached扩展

    在使用下面这种方式安装php7 memcached扩展时,先要安装好memcached服务器yum -y install php70w-pecl-memcached

  9. windows安装 php-redis redis 扩展

    1.查看phpinfo(),确定要下载的扩展版本,扩展的下载地址在:https://pecl.php.net/package/redis 上图对应是是以下版本 2.把下载包里的文件放到php的ext文 ...

  10. mac 安装php redis扩展

    git clone git://github.com/nicolasff/phpredis.git cd ./phpredis phpize 如果报 Cannot find autoconf. Ple ...

随机推荐

  1. org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

    编程中遇到:org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot ...

  2. Python classes to extract information from the Linux kernel /proc files.

    python/python-linux-procfs/python-linux-procfs.git - Python classes to extract information from the ...

  3. 京东 PC 首页 2019 改版前端总结 原创: 何Jason,EC,小屁 凹凸实验室 今天

    京东 PC 首页 2019 改版前端总结 原创: 何Jason,EC,小屁 凹凸实验室 今天

  4. Comparison and difference for Default geodatabase,Current workspace,Scratch workspace,Home Folder

    Comparison and difference for Default geodatabase,Current workspace,Scratch workspace,Home Folder 商务 ...

  5. TCP为什么会出现 RST

    就目前遇到的情况而言,都是负载设备,或健康检查设备发送的. 为什么会出现 RST 因为具有周期性,我大概猜到了,是 lvs 对我的后端服务的健康检查导致的,联系了网络运营服务客服人员,我把.pcap给 ...

  6. 006 GET API

    1.说明 The get API allows to get a JSON document from the index based on its id. GET通过基于id的索引获取JSON文档. ...

  7. 树莓派 more

    树莓派 rusthttps://tech.iotcomeon.com/2018/06/tech/deploy/515/sudo curl https://sh.rustup.rs -sSf | sh ...

  8. [转]EXCEL截取字符串中某几位的函数——LeftMIDRight及Find函数的使用

    原文地址:http://blog.sina.com.cn/s/blog_3f136a180102ymq5.html EXCEL截取字符串中某几位的函数 ——Left MID Right及Find函数的 ...

  9. 安卓终端-Termux

    Termux是一个 Android 终端模拟器以及提供 Linux 环境的应用程序.跟许多其他应用程序不同,无需 root 设备也无需进行设置.它是开箱即用的!它会自动安装好一个最基本的 Linux ...

  10. Python3入门(十三)——常用内置模块之时间日期模块datatime

    1.日期时间模块——datatime //其他模块例如time.calender等模块暂不展开 (1)获取当前时间:datatime.now(): from datetime import datet ...