To install Redis:
Download: http://www.redis.io/download
Redis-2.6.2.tar.gz
]# TAR-ZXF redis-2.6.2.tar.gz
]# CD redis-2.6.2
Direct compilation, no configuration required
] #make
Enter the SRC directory for installation
] #cd src && make install
Easy to manage, move related files
] #mkdir-P/usr/local/redis/bin
] #mkdir-P/usr/local/redis/etc
Move the files in the Redis directory you just unzipped.
]# mv/lamp/redis-2.6.2/redis.conf/usr/local/redis/etc
]# CD/LAMP/REDIS-2.6.2/SRC
]# mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server/usr/local/redis/bin
The file moved well is basically good, edit the Redis.con configuration file change the following to Yes
Daemonize Yes
To start Redis:
]#/usr/local/redis/bin/redis-server/usr/local/redis/etc/redis.conf
Go to the Redis console
]#/usr/local/redis/bin/redis-cli
OK, so I've got the Redis installed.
Installation of the Phpredis extension
Download: Https://github.com/nicolasff/phpredis
] #unzip Phpredis-master.zip
] #cd Phpredis-master
]#/usr/local/php/bin/phpize
]#./configure--with-php-config=/usr/local/php/bin/php-config
] #make && make install
If there is a redis.so in this directory/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/this step,
And then the editor php.ini.
] #vi/usr/local/php/etc/php.ini
#查找extension_dir, modified to
Extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"//This step, I did not change this, using the default value can also
#添加redis
Extension = redis.so
The Nginx or Apache, PHP-FPM and so on the restart, see Phpinfo, the following description is OK
centos6.2 installation of Redis and Phpredis extensions, pro-test