I. Installation of Redis (only available on the server and not yet accessible through the browser)
(1) First download Redis:wget http://download.redis.io/releases/redis-4.0.9.tar.gz
(2) Decompression REDIS:TAR-ZXVF redis-4.0.9.tar.gz
(3) Go to Redis directory: CD redis-4.0.9
(4) Make compile: Make
(5) Enter the SRC directory of Redis to execute: CD src
(6) Perform open redis:./redis-server
If you see the unique official Redis logo, the installation is successful, or it can be executed./REDIS-CLI Open Redis Client, perform simple set operation, if can get the description of installation success
Second, installation
Phpredis (can be accessed via the browser at this time)
(1) Download Phpredis installation package: wget Https://github.com/phpredis/phpredis/archive/develop.zip
(2) Decompression Phpredis:unzip Develop.zip
(3) Enter Phpredis directory: CD CD phpredis-develop/
(4) Generate Configure files using Phpize:/usr/local/php7-legend/bin/phpize
(5) Then check that the current environment meets the dependencies to install the software:./configure--with-php-config=/usr/local/php7-legend/bin/php-config
(5) Then compile: make-j
(6) Then install: Make install
(7) Then go to php Custom extension directory:/usr/local/php7-legend/lib/php/extensions/no-debug-non-zts-20160303/
(8) Normal should be able to see: redis.so
(9) Then add the Redis extension to the configuration file configuration: cd/usr/local/php7-legend/lib/
(10) Added: extension=redis.so
(11) Remember to restart PHP-FPM, and then see if the phpinfo information has a redis extension
This is the time to execute the following code test (Redis server must be turned on)
$redis = new Redis (), $redis->connect (' 127.0.0.1 ', 6379), $redis->set ("Who", "Me"), $test = $redis->get ("who"); Var_dump ($test);
Install Redis under the PHP environment in CentOS