centos7+redis+php环境配置

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介:

 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
目录
相关文章
|
7天前
|
NoSQL Linux 网络安全
基于 centOS7 的 redis 安装
基于 centOS7 的 redis 安装
36 1
|
8天前
|
网络协议 Unix 应用服务中间件
PHP-FPM 性能配置优化
该文介绍了PHP-FPM的性能配置优化,包括其工作原理和与Nginx的配合。FastCGI是一种提高CGI效率的协议,PHP-FPM是它的管理器。文章对比了CGI和FastCGI的区别,指出FastCGI更高效,能处理更多请求。接着讨论了php-fpm的进程数调优,包括ondemand(按需创建)、dynamic(动态创建)和static(固定数量)三种模式,以及各自适用场景和参数配置。
20 0
PHP-FPM 性能配置优化
|
10天前
|
运维 JavaScript Serverless
Serverless 应用引擎产品使用合集之php工程已经部署,可以正常访问数据库,静态资源样式无法正常加载,要怎么配置
阿里云Serverless 应用引擎(SAE)提供了完整的微服务应用生命周期管理能力,包括应用部署、服务治理、开发运维、资源管理等功能,并通过扩展功能支持多环境管理、API Gateway、事件驱动等高级应用场景,帮助企业快速构建、部署、运维和扩展微服务架构,实现Serverless化的应用部署与运维模式。以下是对SAE产品使用合集的概述,包括应用管理、服务治理、开发运维、资源管理等方面。
Serverless 应用引擎产品使用合集之php工程已经部署,可以正常访问数据库,静态资源样式无法正常加载,要怎么配置
|
14天前
|
NoSQL 关系型数据库 应用服务中间件
jdk1.8、mysql、redis、nginx centos云服务器安装配置
jdk1.8、mysql、redis、nginx centos云服务器安装配置
|
16天前
|
Linux
centos bond多网关配置 bond多网关路由
centos bond多网关配置 bond多网关路由
|
10天前
|
运维 NoSQL Serverless
Serverless 应用引擎产品使用合集之需要配置什么才能够使用Redis
阿里云Serverless 应用引擎(SAE)提供了完整的微服务应用生命周期管理能力,包括应用部署、服务治理、开发运维、资源管理等功能,并通过扩展功能支持多环境管理、API Gateway、事件驱动等高级应用场景,帮助企业快速构建、部署、运维和扩展微服务架构,实现Serverless化的应用部署与运维模式。以下是对SAE产品使用合集的概述,包括应用管理、服务治理、开发运维、资源管理等方面。
|
11天前
|
Linux PHP Windows
蓝易云 - php环境变量的配置步骤
以上就是配置PHP环境变量的步骤,希望对你有所帮助。
10 0
|
15天前
|
监控 NoSQL Redis
Redis哨兵,Redis哨兵核心功能如何一个云服务器完成6个节点的搭建-docker什么是docker是否可以把六个容器,都写到同一个ym配置中,一次都启动,不就直接保证互通问题了吗?
Redis哨兵,Redis哨兵核心功能如何一个云服务器完成6个节点的搭建-docker什么是docker是否可以把六个容器,都写到同一个ym配置中,一次都启动,不就直接保证互通问题了吗?
|
15天前
|
PHP Windows
windows 安装php7.4并配置phpstorm环境
windows 安装php7.4并配置phpstorm环境
|
16天前
|
开发工具
centos8 yum安装mysql8 流程配置
centos8 yum安装mysql8 流程配置