1. Installing the Redis Service
1.1 Checking the installation dependency program
Yum Install gcc-c++
Yum Install-y tcl
Yum Install wget
1.1.1 Download Redis installation package
① official website Download Http://redis.io
②wget command wget http://download.redis.io/redis-stable.tar.gz
1.1.2
TAR-ZXVF redis-stable.tar.gz
1.1.3 Compiling and installing
CD redis-stable
Make
Make install
Note: If you execute redis-server–v (View version command) at this time, if prompted redis-server command not found, you need to add the/usr/local/bin directory to the environment variables, how to do, here do not do a detailed introduction, you can view the changes/ Etc/profile, (View environment Variables command: Echo $PATH)
1.2 Modifying a configuration file
1.2.1 Create profile directory and dump file PID log directory
Place the configuration file under/etc
Cd/etc
mkdir Redis
Dump file PID log and so on/var
Cd/var
mkdir Data Log Run
1.2.2 Modifying configuration files, configuring parameters
Copy the redis.conf file from the unpacked file to the/etc/redis
CP Redis.conf/etc/redis
Vi/etc/redis Modify the configuration file following information
Port 6379
Pidfile/var/redis/run/redis.pid
Dir/var/redis/data
Logfile/var/redis/log/redis.log
1.2.3 Persistence
The default RDB, you can choose whether to turn on aof, if enabled, modify the configuration file AppendOnly
1.2.4 Start and close
① Start Cd/bin
Redis-server/etc/redis/redis.conf
② off
Redis-cli-h 127.0.0.1-p 6379 shutdown
1.2.5 Viewing processes
Ps-ef |gref Redis-server
2. Install Phpredis Extended---environment PHP7
2.1 Download PHP7 corresponding Phpredis to the specified directory
git clone Https://github.com/nicolasff/phpredis
2.2 Generate configure configuration file with Phpize in this directory
CD Phpredis
/usr/local/php/bin/phpize
2.3 Configuration
./configure--with-php-config=/usr/local/php/bin/php-config
2.4 Compiling
Make
2.5 Installation
Make install
2.6 Configuring PHP.ini
Add a row extensio=redis.so
2.7 Restart Nginx, PHP-FPM
================ to this point, the Linux environment Phpredis installation is complete =========
Installation of basic--redis in Linux environment