: This article describes how to install the redis extension in PHP. if you are interested in the PHP Tutorial, refer to it. PHP extensions have a lot, refer to: http://redis.io/clients#php
Official targets are phpredis Predis. phpredis is written in C, which is highly efficient. Predis is written in PHP and can be seen directly in the source code.
Download phpredis, on the one hand is that the performance is good, on the other hand, the main is to use it to save session, address: https://github.com/phpredis/phpredis/tree/2.2.7
I don't know why there are so many branches in phpredis, or directly go down to 2.2.7.
Before installing phpredis, you need to install an extension of igbinary because it will be used. Reference: https://pecl.php.net/package/igbinary
pecl install igbinary
After installation, add the extension information to php. ini.
extension=igbinary.so
The installation method is also very simple, refer to: https://github.com/phpredis/phpredis/tree/master#installation
phpize./configure [--enable-redis-igbinary]make && make install
Redis. so will be displayed in/usr/lib64/php/modules/. add the extension to php. ini and add it to igbinary. so.
========================================================== ========================================================== =
Install igbinary in windows
Reference: https://pecl.php.net/package/igbinary/1.2.1/windows
Download the corresponding version of dll and add it to the php. ini extension.
Reference: http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/
Download the corresponding version of dll and add it to the php. ini extension.
According to phpredis, there are two types of connection to redis: connect and pconnect. according to the reference materials, pconnect's close () only does not allow php to continue accessing redis and does not directly close the connection, the entire lifecycle of php-fpm is valid.
Reference: http://m.blog.csdn.net/blog/qmhball/46988111
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above describes how to install the redis extension in PHP, including some content, and hope to help those who are interested in the PHP Tutorial.