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) 扯淡: 最近一直在慢慢多学习各个组件,自己搭建出一些想法.是一个涉猎的过程,慢慢意识到知识是可以融汇贯通,举一反三的,不过前提好像是研究的比较深,有了自己的见解.自认为学习 ...
随机推荐
- Vue + Element ui 实现动态表单,包括新增行/删除行/动态表单验证/提交功能
总结/朱季谦 最近通过Vue + Element ui实现了动态表单功能,该功能还包括了动态表单新增行.删除行.动态表单验证.动态表单提交功能,趁热打铁,将开发心得记录下来,方便以后再遇到类似功能时, ...
- jar包、war包项目部署
部署 部署 jar包 部署 war包 部署 jar包 环境准备 JDK Tomcat Linux 环境 1.将jar文件上传至服务器 2.编写脚本 启动脚本放在跟jar 一起的路径下,如果不放在同一路 ...
- 如何使用C#中的Lambda表达式操作Redis Hash结构,简化缓存中对象属性的读写操作
Redis是一个开源的.高性能的.基于内存的键值数据库,它支持多种数据结构,如字符串.列表.集合.散列.有序集合等.其中,Redis的散列(Hash)结构是一个常用的结构,今天跟大家分享一个我的日常操 ...
- DolphinScheduler3.1.7集成SAP HANA
源码地址:GitHub - apache/dolphinscheduler at 3.1.7-release 个人fork gitee地址:DolphinScheduler:Gitee) 后端代码更改 ...
- 想在golang里用好泛型还挺难的
golang的泛型已经出来了一年多了,从提案被接受开始我就在关注泛型了,如今不管是在生产环境还是开源项目里我都写了不少泛型代码,是时候全面得回顾下golang泛型的使用体验了. 先说说结论,好用是好用 ...
- 我真的不想再用mybatis和其衍生框架了选择自研亦是一种解脱
我真的不想再用mybatis和其衍生框架了选择自研亦是一种解脱 文档地址 https://xuejm.gitee.io/easy-query-doc/ GITHUB地址 https://github. ...
- 若依前后端分离版:增加新的登录接口和新的用户表,用于小程序或者APP获取token,并使用若依的验证方法
相关原创链接直接放这: 基于若依框架springsecurity添加多种用户登录解决方案(springsecurity多用户登录:前端用户.后端用户)_若依多用户表登录_云优的博客-CSDN博客 若依 ...
- 《VTK图形图像开发进阶》第1-2章——一个稍微复杂的VTK程序
VTK概览 数据可视化主要是通过计算机图形学的方法,以图形.图像等形式清晰有效地传递.表达信息,VTK是数据可视化的工具包. VTK全称(Visualization Toolkit),即可视化工具包, ...
- C++类学习心得
参考文献:https://www.cnblogs.com/xiongxuanwen/p/4290086.html 类的一个重要点是构造函数,其官方说明为: 构造函数是一个特殊的.与类同名的成员函数,用 ...
- 当小白遇到FullGC
起初没有人在意这场GC,直到它影响到了每一天! 前言 本文记录了一次排查FullGC导致的TP99过高过程,介绍了一些排查时思路,线索以及工具的使用,希望能够帮助一些新手在排查问题没有很好的思路时,提 ...
