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.
make
make test
make test时出现如下异常
cd src && make test
make[]: Entering directory `/root/redis-3.0./src'
You need tcl 8.5 or newer in order to run the Redis test
make[]: *** [test] Error
make[]: Leaving directory `/root/redis-3.0./src'
make: *** [test] Error
缺少tcl,安装tcl
yum install tcl
编译,安装
make test
make install
成功安装出现如下提示信息
cd src && make install
make[]: Entering directory `/root/redis-3.0./src' Hint: It's a good idea to run 'make test' ;) INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[]: Leaving directory `/root/redis-3.0./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: [] y
Selecting default:
Please select the redis config file name [/etc/redis/.conf]
Selected default - /etc/redis/.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/]
Selected default - /var/lib/redis/
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port :
Config file : /etc/redis/.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/
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/.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels !
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查看是否已经安装成功。