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) 扯淡: 最近一直在慢慢多学习各个组件,自己搭建出一些想法.是一个涉猎的过程,慢慢意识到知识是可以融汇贯通,举一反三的,不过前提好像是研究的比较深,有了自己的见解.自认为学习 ...
随机推荐
- Multi-Modal Attention Network Learning for Semantic Source Code Retrieval 解读
Multi-Modal Attention Network Learning for Semantic Source Code Retrieva Multi-Modal Attention Netwo ...
- GO web学习(二)
跟着b站https://space.bilibili.com/361469957 杨旭老师学习做的笔记 Response响应 ResponseWriter 包括Writer,WriterHeader, ...
- CentOS 7 搭建NFS服务器
服务端安装 # 创建挂载目录 cd ~ cd data/ mkdir www-content cd www-content/ pwd # 安装软件 yum install nfs-utils yum ...
- java使用SFTP连接服务器下载,上传文件
package mocha.framework.util; /* * @author Xiehj * @version 2019年10月28日 上午9:37:28 */ import java.io. ...
- HTML前端js
ajax请求方法书写 $.ajax({ type:"POST", url:CONTEXT_PATH+"/appAudit/insertSnDocCountAdmin&qu ...
- 阿里云容蓓:DCDN 助力云原生时代的应用构建及最佳实践
在数字化转型速度不断提升的今天,大带宽.低时延.高并发的场景不断涌现,内容分发网络(Content Delivery Network,CDN)应用需求还在不断攀升,打造更高质量的CDN服务将成为新时代 ...
- opensbi入门
OpenSBI 入门 声明 本文为本人原创,未经允许,严禁转载. FW_JUMP FW_PAYLOAD FW_DYNAMIC FW_JUMP OpenSBI 带跳转地址的固件(FW_JUMP)是一种仅 ...
- Composer 镜像原理 (2) —— composer.json
相关文章 Composer 镜像原理 (1) -- 初识 Composer Composer 镜像原理 (2) -- composer.json Composer 镜像原理 (3) -- 完结篇 有使 ...
- 输入平方米的三种方式㎡ m2 m²
如何在Word中输入平方米字符? 第1种方法 Win10自带输入法,输入"平方米",默认第5个就出来了㎡,也可以直接复制使用. 这种方式最直接,字母m和右上角的2是1个字符,所以不 ...
- 没有显示器可用的电脑找IP
一台在手边没有显示器可用的电脑找IP记录 问题 老大给我一台服务器(在我前面的工位)让我自己玩,但是不知道IP地址,我本来想用自己的显示器连上,结果两个DHMI口试过都没反应,不知道ip地址就没法连上 ...
