1. Download the installation package
Come to PHP's official extension and search for Redis, find the stable version of the stable package, download it locally, and prepare for the extended installation
Pecl (The PHP Extension Community Library) Address: http://www.pecl.php.net/
Redis:http://www.pecl.php.net/get/redis-2.2.4.tgz
2, compiling the expansion pack
First unzip the Redis expansion pack, then go to the directory and execute:
/usr/local/php/bin/phpize
If you do not have an error, proceed:
./configure--with-php-config=/usr/local/php/bin/php-config
If configure error is not reported , continue execution:
Make && make install
After success, you will be prompted with the redis.so file directory, as follows:
Then copy the redis.so file to the PHP extension directory, and then modify the php.ini file to add a line:
Extension=redis.so
Restart the server, you can see the extension information in the phpinfo ()!
PHP compiled Redis extensions