本文共 2001 字,大约阅读时间需要 6 分钟。
centos7+redis+php环境配置
wget http://download.redis.io/releases/redis-3.0.7.tar.gz
tar -zxvf redis-3.0.7.tar.gzcd redis-3.0.7makemake test
make test时出现如下异常
cd src && make testmake[1]: Entering directory `/root/redis-3.0.7/src'You need tcl 8.5 or newer in order to run the Redis testmake[1]: *** [test] Error 1make[1]: Leaving directory `/root/redis-3.0.7/src'make: *** [test] Error 2
缺少tcl,安装tcl
yum install tcl
编译,安装
make testmake install
成功安装出现如下提示信息
cd src && make installmake[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 installmake[1]: Leaving directory `/root/redis-3.0.7/src'
cd utils ./install_server.sh Welcome to the redis service installerThis script will help you easily set up a running redis serverPlease select the redis port for this instance: [6379] ySelecting default: 6379Please select the redis config file name [/etc/redis/6379.conf] Selected default - /etc/redis/6379.confPlease select the redis log file name [/var/log/redis_6379.log] Selected default - /var/log/redis_6379.logPlease select the data directory for this instance [/var/lib/redis/6379] Selected default - /var/lib/redis/6379Please select the redis executable path [/usr/local/bin/redis-server] Selected config:Port : 6379Config file : /etc/redis/6379.confLog file : /var/log/redis_6379.logData dir : /var/lib/redis/6379Executable : /usr/local/bin/redis-serverCli Executable : /usr/local/bin/redis-cliIs this ok? Then press ENTER to go on or Ctrl-C to abort.Copied /tmp/6379.conf => /etc/init.d/redis_6379Installing service...Successfully added to chkconfig!Successfully added to runlevels 345!Starting Redis server...Installation successful!
修改redis.conf
daemonize on
改为
daemonize yes
此时为后台启动
./src/redis-server ./redis.conf
yum install php-redis
通过phpinfo查看是否已经安装成功。
转载地址:http://oheql.baihongyu.com/