PHP5.5 install PHPRedis extension and connection test method, php5.5phpredis
This document describes how to install PHPRedis extension and test the connection in PHP5.5. We will share this with you for your reference. The details are as follows:
Phpredis is the best php-redis client, because the function provided by phpredis is basically the same as the redis command, reducing the learning cost and comprehensive functions.
I. linux Installation Method
Phpredis: https://github.com/nicolasff/phpredis
unzip phpredis-master.zipcd phpredis-master/usr/local/php5/bin/phpize./configure --with-php-config=/usr/local/php5/bin/php-configmakemake installvi /usr/local/php5/etc/php.ini
Join:
extension=redis.so
Restart Apache after saving the file. If the nginx is connected, restart php-fpm.
Ii. windows Installation Method
Download the compiled dll file from the Internet. You must select the version corresponding to php.
Php_redis-5.5-vc11-ts-x86-00233a.zip http://d-h.st/4A5
Php_igbinary-5.5-vc11-ts-x86-c35d48.zip http://d-h.st/QGH
Php_redis-5.5-vc11-nts-x86-00233a.zip http://d-h.st/uGS
Php_igbinary-5.5-vc11-nts-x86-c35d48.zip http://d-h.st/bei
Php_redis-5.5-vc11-ts-x64-00233a.zip http://d-h.st/1tO
Php_igbinary-5.5-vc11-ts-x64-c35d48.zip http://d-h.st/rYb
Php_redis-5.5-vc11-nts-x64-00233a.zip http://d-h.st/N0d
Php_igbinary-5.5-vc11-nts-x64-c35d48.zip http://d-h.st/c1a
After the download, put php_igbinary.dll and php_redis.dll in the php ext directory,
Modify php. ini and add the two extensions. Do not reverse the order.
extension=php_igbinary.dllextension=php_redis.dll
Restart Apache.
PHP test code:
<?php $redis = new Redis(); $redis->connect('127.0.0.1',6379); $redis->set('test','hello world!'); echo $redis->get('test');?>