Installing Redis Extensions for PHP under Windows

Source: Internet
Author: User
Tags phpinfo redis tutorial

1. Use the Phpinfo () function to view PHP version information, which will determine the extension file version.

2. Download Php_igbinary-1.2.1-5.5-ts-vc11-x64.zip,php_redis-2.2.5-5.6-ts-vc11-x64.zip (be sure to make sure the version is correct)

http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/

Http://windows.php.net/downloads/pecl/releases/igbinary/1.2.1/

3. After decompression, copy the Php_redis.dll and php_redis.pdb to the PHP ext directory

4. Modify the PHP.ini, (PS: This php.ini file is in the Apache directory) to include in the file:

; Php_redis

Extension=php_igbinary.dll

Extension=php_redis.dll

Note: Extension=php_igbinary.dll must be placed in front of extension=php_redis.dll, otherwise this extension will not take effect

5. After restarting Apache, use Phpinfo to see if the extension was installed successfully

6. After you open the Redis service, you can test whether it can be called with the following.

1 <?php 2//Connect the local Redis service 3 $redis = new Redis (); 4 $redis->connect (' 127.0.0.1 ', 6379); 5 echo "Connection to server sucessfully"; 6//Set Redis string Data 7 $redis->set ("Tutorial-name", "Redis Tutorial"); 8//Get the stored data and output 9 echo "Stored string in Redis::". $redis->get ("Tutorial-name");?>

Installing Redis Extensions for PHP under Windows

Related Article

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.