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) 扯淡: 最近一直在慢慢多学习各个组件,自己搭建出一些想法.是一个涉猎的过程,慢慢意识到知识是可以融汇贯通,举一反三的,不过前提好像是研究的比较深,有了自己的见解.自认为学习 ...
随机推荐
- 了解O2OA(翱途)开发平台中的VIP应用
使用O2OA(翱途)开发平台可以非常方便地进行项目的业务需求开发与实施,O2OA(翱途)开发平台并不限制实现的系统类型,所以能实现的系统很多,最终呈现的项目成果也是多样性的,可能是OA系统,可能是人力 ...
- FlutterWeb部署到服务器
目标:把flutter web项目部署到自己的服务器上,可以使用自己的服务器IP访问 前提:服务器已经安装了nginx, 这是我的flutter配置 edz@lwqdeMacBook-Pro ~ % ...
- 10/28-29_String类_SrtingBuffer类_Interger类_笔记
API:应用程序编程接口 String功能 public String replace (char oldchar ,char newchar); //符串中某一字符被一新字符替换 public St ...
- Seal AppManager如何基于Terraform简化基础设施管理
作者简介 陈灿,数澈软件Seal 后端研发工程师,曾在腾讯负责敏捷研发体系建设以及 DevOps 解决方案的敏捷实践.在敏捷研发和产品效能提升有着丰富的经验,致力于构建一站式研发友好的平台工程解决方案 ...
- C# 12新预览功能介绍
Visual Studio 17.7 Preview 3和.NET 8 Preview 6延续了C# 12的发展.该预览版包含的功能旨在为未来的性能增强奠定基础.对内联数组的轻松访问将允许库在更多地方 ...
- 使用Docker+PHP搭建苹果Maccms的影视站详细教程
自己做博客站太难了,SEO太差自己都搜不到,原文地址求你点进去看:https://typecho.hanzhe.site/archives/88 说在前面 很早之前还没参加工作的时候,手头没钱,想要看 ...
- 如何编写难以维护的React代码?耦合组件
如何编写难以维护的React代码?耦合组件 在许多项目中,我们经常会遇到一些难以维护的React代码.其中一种常见的情况是:子组件直接操作父组件方法,从而导致父子组件深度耦合.这样的实现让子组件过于依 ...
- PostgreSQL+GeoHash地图点位聚合
PG数据库安装扩展 需要用到pg数据库的空间扩展postgis,在进行操作之前需要在数据库中安装扩展. CREATE EXTENSION postgis; CREATE EXTENSION postg ...
- Node: 将时间戳转换成日期并分组
// 对时间戳按日期进行分组 let moment = require('moment') let timestamp_array = [ 1645059333000, 1613523333000, ...
- 华为ensp配置静态路由,三路由,三pc
华为ensp配置静态路由 目的:使pc1,pc2,pc3能相互ping通 1,tuop图的搭建 1,如图所示:先搭建好设备的通讯关系,在标记好每台设备对应的,ip地址和网关. 2,pc的网关,与ip地 ...
