从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. Linux中进程的几种状态

    linux是一个多用户,多任务的系统,可以同时运行多个用户的多个程序,就必然会产生很多的进程,而每个进程会有不同的状态. Linux进程状态:R (TASK_RUNNING),可执行状态. 只有在该状 ...

  2. shell编程系列7--shell中常用的工具find、locate、which、whereis

    shell编程系列7--shell中常用的工具find.locate.which.whereis .文件查找之find命令 语法格式:find [路径] [选项] [操作] 选项 -name 根据文件 ...

  3. 网站无法连接上,但能上QQ的解决办法

    一句话:修改DNS的IP地址 参考win10修改IP地址:https://jingyan.baidu.com/article/19192ad8eef0c9e53e570717.html 在网络上搜索合 ...

  4. RabbitMQ 入门教程(PHP版) 延迟队列,延迟任务

    延迟任务应用场景 场景一:物联网系统经常会遇到向终端下发命令,如果命令一段时间没有应答,就需要设置成超时. 场景二:订单下单之后30分钟后,如果用户没有付钱,则系统自动取消订单. 场景三:过1分钟给新 ...

  5. Linux记录-shell自动化批量部署sql脚本并记录日志信息(转载)

    #!/bin/bash #script_version=v110 db_host=127.0.0.1 db_port=3306 db_username=db_test_inst db_passwd=` ...

  6. Egret的第三方库制作,以及在大型项目中的应用

    目录: 一 创建第三方库 二 TypeScript库 三 JavaScript库 四 第三方库制作在大型RPG中的实际应用 参考: 第三方库的使用方法 目标: 本文目的是将现有游戏的框架制作成第三方库 ...

  7. [ kvm ] 学习笔记 7:KVM 虚拟机创建的几种方式

    通过对 qemu-kvm.libvirt 的学习,总结三种创建虚拟机的方式: (1)通过 qemu-kvm 创建 (2)通过 virt-install 创建 (3)通过 virt-manager 创建 ...

  8. Django: ORM查询中使用or查询

    先引入Q,(原名就叫Q) from django.db.models import Q page_user = User.objects.filter(Q(member_code__contains= ...

  9. Python爬取网址中多个页面的信息

    通过上一篇博客了解到爬取数据的操作,但对于存在多个页面的网址来说,使用上一篇博客中的代码爬取下来的资料并不完整.接下来就是讲解该如何爬取之后的页面信息. 一.审查元素 鼠标移至页码处右键,选择检查元素 ...

  10. C#本地修改器

    C#本地修改器 C# 制作外挂常用的API C#做外挂的常用API,本人用了很久,基本没发现问题 using System; using System.Collections.Generic; usi ...