Added redis extension and php7redis extension in php7
Add redis extension in PHP7 1. Purpose:
Recently, a new environment was deployed, using PHP7 + nginx and memcache for the old version of nosql. The new version was prepared with redis, So I installed the redis extension.
2. Description:
In fact, you don't need to pay attention to redis extension installation. The main reason is to pay attention to whether the extension supports the PHP version when downloading the extension. Other installation methods are consistent with the common PHP extension installation method.
3. installation steps:
1. Download
: Http://pecl.php.net/package/redis
The download directory is stored in/data/download/php.
Cd to the download directory, download: wget http://pecl.php.net/get/redis-3.1.2.tgz
2. Extract
Unzip to the current directory tar-zxvf redis-3.1.2.tgz
3. Install
Under the cd redis-3.1.2 directory
Use phpize in this directory to generate the configure configuration file: Run/usr/local/php7/bin/phpize directly.
The configuration, compilation, and installation are all completed in this directory.
./Configure -- with-php-config =/usr/local/php7/bin/php-config
Make
Make install
After make install, you will see Installing shared extensions:/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/
This directory is the directory where the redis. so file is generated
Ll/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/
Redis. so indicates that the installation is successful.
4. The configuration supports PHP7:
Vim/usr/local/php7/etc/php. ini
Add extension = redis. so
: Wq!
5. Restart nginx. Restart php-fpm.
Reference: http://www.cnblogs.com/yangxia-test/p/4195198.html