centos7+redis+php环境配置

本文涉及的产品
云原生内存数据库 Tair,内存型 2GB
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
云数据库 Redis 版,经济版 1GB 1个月
简介:

 centos7+redis+php环境配置

  • 下载redis(更多版本可到redis官网进行查找)
wget http://download.redis.io/releases/redis-3.0.7.tar.gz
  • 解压,编译
tar -zxvf redis-3.0.7.tar.gz
cd redis-3.0.7
make
make test

  make test时出现如下异常

cd src && make test
make[1]: Entering directory `/root/redis-3.0.7/src'
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] Error 1
make[1]: Leaving directory `/root/redis-3.0.7/src'
make: *** [test] Error 2

  缺少tcl,安装tcl

yum install tcl

  编译,安装

make test
make install

  成功安装出现如下提示信息

复制代码
cd src && make install
make[1]: Entering directory `/root/redis-3.0.7/src'

Hint: It's a good idea to run 'make test' ;)

    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
make[1]: Leaving directory `/root/redis-3.0.7/src'
复制代码
  • 初始化redis
复制代码
cd 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] y Selecting default: 6379 Please select the redis config file name [/etc/redis/6379.conf] Selected default - /etc/redis/6379.conf Please select the redis log file name [/var/log/redis_6379.log] Selected default - /var/log/redis_6379.log Please select the data directory for this instance [/var/lib/redis/6379] Selected default - /var/lib/redis/6379 Please select the redis executable path [/usr/local/bin/redis-server] Selected config: Port : 6379 Config file : /etc/redis/6379.conf Log file : /var/log/redis_6379.log Data dir : /var/lib/redis/6379 Executable : /usr/local/bin/redis-server Cli Executable : /usr/local/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!
复制代码
  • 修改redis.conf

 

daemonize on

改为

daemonize yes

此时为后台启动

  • 启动redis

 

 ./src/redis-server ./redis.conf 
  • 安装php支持php-redis
yum install php-redis
  •  检测是否成功安装

  通过phpinfo查看是否已经安装成功。






本文转自秋楓博客园博客,原文链接:http://www.cnblogs.com/rwxwsblog/p/5285732.html,如需转载请自行联系原作者
相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
6天前
|
存储 运维 Serverless
函数计算产品使用问题之在YAML文件中配置了环境变量,但在PHP代码中无法读取到这些环境变量,是什么原因
函数计算产品作为一种事件驱动的全托管计算服务,让用户能够专注于业务逻辑的编写,而无需关心底层服务器的管理与运维。你可以有效地利用函数计算产品来支撑各类应用场景,从简单的数据处理到复杂的业务逻辑,实现快速、高效、低成本的云上部署与运维。以下是一些关于使用函数计算产品的合集和要点,帮助你更好地理解和应用这一服务。
|
6天前
|
安全 关系型数据库 MySQL
CentOS 8 中安装与配置 MySQL
CentOS 8 中安装与配置 MySQL
51 3
|
7天前
|
缓存 Linux Docker
CentOS 7 下安装 Docker 及配置阿里云加速服务
CentOS 7 下安装 Docker 及配置阿里云加速服务
152 0
|
7天前
|
NoSQL 关系型数据库 MySQL
linux服务器重启php,nginx,redis,mysql命令
linux服务器重启php,nginx,redis,mysql命令
16 1
|
20天前
|
NoSQL Linux 网络安全
基于 centOS7 的 redis 安装
基于 centOS7 的 redis 安装
59 1
|
6天前
|
网络协议 Linux Shell
如何在 CentOS 中配置 SSH 服务的 TCP 端口转发
如何在 CentOS 中配置 SSH 服务的 TCP 端口转发
17 0
|
8天前
|
Java Linux
Centos安装openjdk11并配置JAVA_HOME
Centos安装openjdk11并配置JAVA_HOME
26 0
|
10天前
|
NoSQL Linux 网络安全
centos安装Redis
centos安装Redis
20 0
|
10天前
|
消息中间件 RocketMQ
Centos7.6安装RocketMQ4.9.2并配置开机自启
Centos7.6安装RocketMQ4.9.2并配置开机自启
17 0
|
10天前
|
Java Linux Maven
Centos7.6安装Maven3.8.3并配置阿里云镜像
Centos7.6安装Maven3.8.3并配置阿里云镜像
65 0