First, installation
Initially intended to install Redis directly with Yum, but error: No package Redis available.
After attempting to compile the installation, it is also a variety of errors, only re-think back to the Yum installation method.
Online article said download Epel can find the source of Redis.
Go to related page
Http://fedoraproject.org/wiki/EPEL
There are EPEL 5, EPEL 6, EPEL 73 Different versions of, I think EPEL 7 should be the latest version of it, with the new not old,
Then download the installation, again error ...
Later only know EPEL 5, EPEL 6, EPEL 7 respectively corresponding is CENTOS5, CENTOS6, Centos7, no wonder the installation error ...
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
RPM-IVH epel-release-6-8.noarch.rpm
Yum Install Redis
To this step the installation is complete.
Second, the configuration
Redis-server
Start Redis service side
Redis-cli
Sign in to the Redis client
Starting the server with Redis-server is not started in the background, and when the Linux client is shut down it will stop running.
We want to set up Redis to run automatically on the boot background.
Because it is a period of time to write this blog, forget the self-initiated file is what type of-_-| | |
Set Boot start service
sudo chkconfig redis on
There are also settings in the relevant text, but the Chkconfig command is relatively simple and silly home.
Open service
Service Redis Start
This will not occupy the window, directly in the background silently run
Third, the PHP operation Redis
There are two methods, one is Phpredis need to install the extension, this way access is much faster. A predis needs to download the class file.
Predis installation is relatively simple, I am lazy, temporary project on the performance requirements are not very high, so the use of Predis to operate Redis.
Iv. Manuals and Tutorials
The REDIS Getting Started Guide
"Phpredis Chinese Handbook" (http://www.cnblogs.com/ikodota/archive/2012/03/05/php_redis_cn.html)
Installation and use of Redis