First, install the compilation tool
Yum install wget make gcc gcc-c++ zlib-devel OpenSSL openssl-devel pcre-devel kernel keyutils Patch Perl
Second, the installation of Redis Php-redis
# yum Install Redis Php-redis
So the installation is successful.
Start Redis
# sudo redis-server/etc/redis.conf
1. Download Php-redis Zip installation package
Https://github.com/nicolasff/phpredis
2. Find the PHP installation path
Command Whereis phpize and Whereis php-config find phpize and php-config paths
3. Generate Configure
#/usr/bin/phpize
4. Compile and install
#./configure--with-php-config=/usr/bin/php-config# make && make install
5, add the installed redis.so module
# Vim/etc/php.ini
6. Restart Apache or Nginx
7. Testing
$redis = new Redis (), $redis->connect (' 127.0.0.1 ', 6379), $redis->set (' Test ', ' Hello world! '); echo $redis->get (' Test ');