centos 6.8 配置 Redis3.2.5
配置Redis3.2.5 与 php-redis
一、配置Redis
1、下载Redis3.2.5安装包
[root@zhangsan /] wget http://download.redis.io/releases/redis-3.2.5.tar.gz
[root@zhangsan /]tar -zxvf redis-3.2..tar.gz -C /usr/src/
[root@zhangsan /]cd /usr/src/redis-3.2./
[root@zhangsan /]make && make install
[root@iZ2z /]mkdir -p /home/redis/bin
[root@iZ2z /]mkdir -p /home/redis/log
[root@iZ2z /]mkdir -p /home/redis/pid
[root@iZ2z /]mkdir -p /home/redis/db
[root@iZ2z /]ln -s /usr/local/bin/redis-* /home/redis/bin/
[root@iZ2z /]cp redis.conf /home/redis/
[root@iZ2ze /]cd /home/redis/
[root@iZ2ze /]vim /home/redis/redis.conf
#根据实际需要修改配置文件,以下仅供参考
#!/bin/sh
#
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
PATH=/home/redis/bin:/sbin:/usr/bin:/bin
REDISPORT=
EXEC=/home/redis/bin/redis-server
CLIEXEC=/home/redis/bin/redis-cli
PIDFILE=/home/redis/pid/redis.pid
CONF="/home/redis/redis.conf" case "$1" in
start)
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Redis server..."
$EXEC $CONF
fi
;;
stop)
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping ..."
$CLIEXEC -p $REDISPORT shutdown
while [ -x /proc/${PID} ]
do
echo "Waiting for Redis to shutdown ..."
sleep
done
echo "Redis stopped"
fi
;;
*)
echo "Please use start or stop as first argument"
;;
esac
[root@iZ2ze /] chmod a+x /etc/init.d/redis
[root@iZ2ze /] service redis start
[root@iZ2ze /] ps -ef | grep redis
[root@iZ2ze /] netstat -anptu | grep 6379
[root@iZ2ze /]redis-cli set key1 hello get key1
quit
二、配置php-redis
1.下载phpredis
[root@iZ2ze /]git clone https://github.com/phpredis/phpredis.git
[root@iZ2ze /]cd phpredis
2.开始编译phpredis扩展
[root@iZ2ze /] make
[root@iZ2ze /] make install
3.安装配置phpredis扩展
检查redis.so 库文件是否存在
[root@iZ2z /]# cd /usr/lib64/php/modules
[root@iZ2z modules]# ls
redis.so
#修改php.ini配置文件
[root@iZ2z modules] vim /etc/php.ini //第881行
extention=redis.so //添加这一行扩展配置
[root@iZ2z modules] service php-fpm restart //重启php服务
//如果未能安装成功 请检查php配置文件是否成功添加配置并重启服务

参考文章:http://www.cnblogs.com/jeffen/p/6066325.html?utm_source=itdadao&utm_medium=referral
http://www.cnblogs.com/jimmy-lin/p/6426925.html
centos 6.8 配置 Redis3.2.5的更多相关文章
- 摘要: CentOS 6.5搭建Redis3.2.8伪分布式集群
from https://my.oschina.net/ososchina/blog/856678 摘要: CentOS 6.5搭建Redis3.2.8伪分布式集群 前言 最近在服务器上搭建了 ...
- CentOS下Apache配置多域名或者多端口映射
CentOS下Apache默认网站根目录为/var/www/html,假如我默认存了一个CI项目在html文件夹里,同时服务器的外网IP为ExampleIp,因为使用的是MVC框架,Apache需开启 ...
- CentOS 6.3配置PPTP VPN的方法
1.验证ppp 用cat命令检查是否开启ppp,一般服务器都是开启的,除了特殊的VPS主机之外. [root@localhost1 /]# cat /dev/ppp cat: /dev/ppp: No ...
- 基于VMware为CentOS 6.5配置两个网卡
为CentOS 6.5配置两块网卡,一块是eth0,一块是eth1,下面以master为例 1.选择“master”-->“编辑虚拟机设置”,如下所示 2.单击“添加”,如下 3.选择“网络适配 ...
- Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)
Centos下安装配置LAMP(Linux+Apache+MySQL+PHP) 关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...
- CentOS 6.5配置nfs服务
CentOS 6.5配置nfs服务 网络文件系统(Network File System,NFS),一种使用于分散式文件系统的协议,由升阳公司开发,于1984年向外公布.功能是通过网络让不同的机器.不 ...
- CentOS安装与配置LNMP
本文PDF文档下载:http://www.coderblog.cn/doc/Install_and_config_LNMP_under_CentOS.pdf 本文EPUB文档下载:http://www ...
- [转]CENTOS 6.5 配置YUM安装NGINX+服务器负载均衡
原文连接: CENTOS 6.5 配置YUM安装NGINX http://blog.sina.com.cn/s/blog_69f467b70102uyux.html 参考博文: Centos下安装. ...
- Tigase XMPP Server在CentOS部署和配置
Tigase XMPP Server在CentOS部署与配置 作者:chszs,转载需注明.博客主页:http://blog.csdn.net/chszs 以下讲述Tigase XMPP Server ...
随机推荐
- CSS揭秘—灵活的背景图(三)
前言: 所有实例均来自<CSS揭秘>,该书以平时遇到的疑难杂症为引,提供解决方法,只能说秒极了,再一次刷新了我对CSS的认知 该书只提供了关键CSS代码,虽然有在线示例代码链接,但访问速度 ...
- python安装第三方库报错visual c++ 14.0 is required
使用python安装第三方库时报错如下: error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ ...
- 测试 ASP.NET Core API Controller
本文需要您了解ASP.NET Core MVC/Web API, xUnit以及Moq相关知识. 这里有xUnit和Moq的介绍: https://www.cnblogs.com/cgzl/p/917 ...
- 【深度学习篇】--神经网络中的调优一,超参数调优和Early_Stopping
一.前述 调优对于模型训练速度,准确率方面至关重要,所以本文对神经网络中的调优做一个总结. 二.神经网络超参数调优 1.适当调整隐藏层数对于许多问题,你可以开始只用一个隐藏层,就可以获得不错的结果,比 ...
- ActivityJump+ActivityManager【Activity之间的跳转和Activity任务栈管理】
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 封装Activity跳转的方法以及实现Activity任务栈管理. 效果图 代码分析 ActivityJump:封装Activi ...
- 聊聊数据库~4.SQL优化篇
1.5.查询的艺术 上期回顾:https://www.cnblogs.com/dotnetcrazy/p/10399838.html 本节脚本:https://github.com/lotapp/Ba ...
- python实现某目录下将多个文件夹内的文件复制到一个文件夹中
现实生活中,我们经常有这样的需求,如下图,有三个文件夹,文件夹1内含有1.txt文件 文件夹2中内含有2.txt文件,文件夹3中含有3.txt文件.我们有时候需要把1.txt, 2.txt, 3.tx ...
- AI产品的商业模式
AI产品的商业模式 ------------------------------------------------------------------------------------------ ...
- weUI之分页查询实现
本文旨在介绍移动端h5分页查询实现 1.前端html 前端基于weui 样式库实现 参考http://jqweui.com/ <div class="weui-search-bar ...
- 弹性布局--flex方向
flex方向 flex方向由flex-direction特性决定,用于定义弹性布局模式.flex-direction共有4种模式:从左向右.从右向左.从上往下.从下往上. 主轴 主轴的起点与终点定义了 ...