The previous articles introduced the installation and use of Redis. Next, we will introduce how to add Redis extension to PHP!
The PHP manual does not provide Redis classes and methods, nor does it provide related extension modules, but we can download PHP extensions from the Redis official website. There are many extensions in it. We only take phpredis as an example.
<span>1</span> tar -zxvf phpredis-2.2.7.tar.gz
phpize5
wget http:<span>//</span><span>pecl.php.net/get/igbinary-1.2.1.tgz</span>./<span>configure make sudo make install</span>
./configure --enable-redis-<span>igbinary make <br></span>sudo make install
extension=igbinary.<span>so extension</span>=redis.so
Use phpinfo() to view
Reference document:
Php-Redis installation test summary
The above introduces the addition of Redis module to PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.