PHP5.5 install PHPRedis extension and connection test method, php5.5phpredis

Source: Internet
Author: User

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');?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.