Redis平台-整合PHP
1.Redis的相关介绍:
定义:
yum install gcc-c++ -y
#下载redis源码包
wget http://download.redis.io/releases/redis-5.0.7.tar.gz
tar xf redis-5.0.7.tar.gz
cd redis-5.0.7
#redis服务无需进行预编译,但需改一下文件的安装路径
Vim src/Makefile 添加:PREFIX?=/usr/local/redis
make && make install
#或者直接安装:
make PREFIX=/usr/local/redis install
#复制redis.conf配置文件到/usr/local/redis
[root@localhost redis-5.0.7]#cp redis.conf /usr/local/redis #配置redis启动脚本
[root@localhost redis-5.0.7]# ./utils/install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf] /usr/local/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] /usr/local/redis/6379.log
Please select the data directory for this instance [/var/lib/redis/6379] /usr/local/redis/6379
Please select the redis executable path [] /usr/local/redis/bin/redis-server
Selected config:
Port : 6379
Config file : /usr/local/redis/6379.conf
Log file : /usr/local/redis/6379.log
Data dir : /usr/local/redis/6379
Executable : /usr/local/redis/bin/redis-server
Cli Executable : /usr/local/redis/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
[root@localhost redis-5.0.7]# #设置环境变量
echo "export PATH="/usr/local/redis/bin:PATH"" >>/etc/profile.d/redis.sh
source /etc/profile.d/redis.sh
3.php整合redis连接驱动
# 源码方式安装php,整合redis:
wget https://github.com/phpredis/phpredis/archive/4.2.0.tar.gz
tar xf 4.2.0.tar.gz
cd phpredis-4.2.0/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-redis
make && make install #编辑php.ini配置文件,添加redis模块:
extension=redis.so (在854行上下添加) # yum方式安装php,整合redis:
安装php7.0
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
yum install yum-utils -y
yum-config-manager --enable remi-php70
yum install php php-fpm php-mysql php-redis -y #PS: 以上两种方式,采取其中一种即可
测试redis模块是否添加成功:
#创建info.php文件测试
vim /usr/local/nginx/html/wordpress/info.php
<?php
phpinfo();
?>
webj界面访问:
#查看php是否成功连接Redis
/usr/local/php/bin/php -m
Redis平台-整合PHP的更多相关文章
- Redis+LUA整合使用
.前言 从本章节开始我们就开始讲解一些 Redis 的扩展应用了,之前讲的主从.哨兵和集群都相当重要,也许小公司用不到集群这么复杂的架构,但是也要了解各知识点的原理,只要了解了原理,无论什么时候是有, ...
- SSH框架和Redis的整合(1)
一个已有的Struts+Spring+Hibernate项目,以前使用MySQL数据库,现在想把Redis也整合进去. 1. 相关Jar文件 下载并导入以下3个Jar文件: commons-pool2 ...
- spring和redis的整合
spring和redis的整合-超越昨天的自己系列(7) 超越昨天的自己系列(7) 扯淡: 最近一直在慢慢多学习各个组件,自己搭建出一些想法.是一个涉猎的过程,慢慢意识到知识是可以融汇贯通,举一反三 ...
- 【Spring】17、spring cache 与redis缓存整合
spring cache,基本能够满足一般应用对缓存的需求,但现实总是很复杂,当你的用户量上去或者性能跟不上,总需要进行扩展,这个时候你或许对其提供的内存缓存不满意了,因为其不支持高可用性,也不具备持 ...
- springboot+shiro+redis(单机redis版)整合教程-续(添加动态角色权限控制)
相关教程: 1. springboot+shiro整合教程 2. springboot+shiro+redis(单机redis版)整合教程 3. springboot+shiro+redis(集群re ...
- springboot+shiro+redis(集群redis版)整合教程
相关教程: 1. springboot+shiro整合教程 2. springboot+shiro+redis(单机redis版)整合教程 3.springboot+shiro+redis(单机red ...
- springboot+shiro+redis(单机redis版)整合教程
相关教程: 1. springboot+shiro整合教程 2. springboot+shiro+redis(集群redis版)整合教程 3.springboot+shiro+redis(单机red ...
- Spring Boot + MyBatis + Druid + Redis + Thymeleaf 整合小结
Spring Boot + MyBatis + Druid + Redis + Thymeleaf 整合小结 这两天闲着没事想利用**Spring Boot**加上阿里的开源数据连接池**Druid* ...
- spring与redis简单整合
项目结构 整合需要的依赖 <dependencies> <dependency> <groupId>org.springframework</groupId& ...
- spring和redis的整合-超越昨天的自己系列(7)
超越昨天的自己系列(7) 扯淡: 最近一直在慢慢多学习各个组件,自己搭建出一些想法.是一个涉猎的过程,慢慢意识到知识是可以融汇贯通,举一反三的,不过前提好像是研究的比较深,有了自己的见解.自认为学习 ...
随机推荐
- 记一次 .NET 在线客服系统同时支持 SQL Server 和 MySQL 没卡死分析
前段时间我发表了一系列文章,开始介绍基于 .net core 的在线客服系统开发过程. 有很多朋友一直提出希望能够支持 MySQL 数据库,考虑到已经有朋友在用 SQL Server,我在升级的过程中 ...
- Code Generate V2.0 代码生成器
Code Generate 代码生成器 系统首页 使用说明 系统默认会根据SQL生成字段信息 className.fieldList.classComment 如下所示: 建表语句 CREATE TA ...
- C#解析匿名JSON数据
C#解析匿名JSON数据 使用工具:Newtonsoft.Json 使用方式: //模拟数据 var jsonData = JsonConvert.SerializeObject(new { Name ...
- python打包方法
在Python中,要编写setup.py文件,用于构建和打包你的Python项目,你可以遵循以下步骤: 创建项目目录结构:首先,你需要创建项目的目录结构,包括源代码文件.资源文件等.一个常见的项目结构 ...
- NOIP2022 题解
终于有机会补NOIP的题了 T1 考虑枚举 C 与 F 的纵列 考虑预处理出每个点最左边和最下边可以延伸到哪 之后枚举列,然后对行做类似于扫描线的操作,统计有多少可行的 "第一横行" ...
- 【go笔记】使用WaitGroup控制协程退出
前言 正常情况下,主协程一旦退出,其子协程也会全部中止并退出.为了阻塞主协程,可以使用time.Sleep(),也可以使用WaitGroup. 用法说明 // 导入sync import " ...
- SpringBoot3集成Quartz
目录 一.简介 二.工程搭建 1.工程结构 2.依赖管理 3.数据库 4.配置文件 三.Quartz用法 1.初始化加载 2.新增任务 3.更新任务 4.暂停任务 5.恢复任务 6.执行一次 7.删除 ...
- 基于C#的无边框窗体阴影绘制方案 - 开源研究系列文章
今天介绍无边框窗体阴影绘制的内容. 上次有介绍使用双窗体的方法来显示阴影,这次介绍使用API函数来进行绘制.这里使用的是Windows API函数,操作系统的窗体也是用的这个来进行的绘制. 1. 项目 ...
- python独立脚本应用Django项目的环境
一.需求说明 一直用 Django 在开发一个网站项目,其中的注册用户和登录,都是使用Django自带的认证系统.主要是对密码的加密,在注册或者登录的时候,前端传递多来的密码,我会使用Django的s ...
- 【LaTeX】语法(更新中)
目录 长度 空行 空格 超链接 数学公式 段落中(隐式) 单独成段(显式) 居中,左对齐,右对齐 居中 左对齐 右对齐 参考文献配置 TODO 参考资料 中文支持参考环境配置中的 内容,在这里不做重复 ...