This article describes how to install CentOS6.5 in Redis in PHP Development. 1. install Redis.
1 wget http://download.redis.io/releases/redis-3.2.8.tar.gz 2 tar xzf redis-3.2.8.tar.gz 3 cd redis-3.2.8 4 make 5 6 cd src 7 cp redis-server /usr/local/bin/ 8 cp redis-cli /usr/local/bin/ 9 10 mkdir /etc/redis 11 mkdir /var/redis 12 mkdir /var/redis/637913 cd ../14 cp utils/redis_init_script15 cp redis.conf /etc/redis/6379.conf16 vim /etc/redis/6379.conf
Vim/etc/redis/6379. conf, find the following code and modify
daemonize to yes pidfile to /var/run/redis_6379.pid logfile to /var/log/redis_6379.log dir to /var/redis/6379 maxmemory 268435456
Maxmemory is set to 256 mb. you can set it according to your configuration. Set start: vim/etc/rc. d/rc. local, add the following code
/etc/init.d/redis_6379 start
2. install Redis extension
yum install gitgit clone git://github.com/owlient/phprediscd phpredis/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make install
3. add extension = redis. so to php. ini.
4. Add password protection to Redis.
First, based on security considerations, we need to set a password for redis unless your redis port is closed.
Vim/etc/redis/6379. conf
Find the line and remove the front #, followed by the redis password
Requirepass rds423fsadD
Restart redis.
/Etc/init. d/redis_6379 stop
The above is the details of the instance where CentOS6.5 is installed in Redis in PHP Development. For more information, see other related articles in the first PHP community!