Configure the redis module in XAMPP under win7

Source: Internet
Author: User
: This article describes how to configure the redis module in XAMPP under win7. if you are interested in the PHP Tutorial, refer to it. 1. use phpinfo () to view the PHP version

My computer shows the result: php 5.6 32-bit.

2. download the php-redis module of the corresponding version,

Put the downloaded php_redis.dll and php_igbinary.dll under xampp/php/ext,

Modify php. ini and add:

extension=php_igbinary.dllextension=php_redis.dll

Restart XAMPP. then, you can see that the redis module is loaded normally in phpinfo.

I encountered many problems during installation. I will summarize them as follows:

1. download the phpredis module of the corresponding php version;

2. check whether it is 32-bit or 64-bit. This depends on the Architecture output by phpinfo (), rather than the number of digits of the operating system.

3. during Download, The-ts-is thread-safe, and The-ns-is non-thread-safe.

4. download from here

III. example

$ Redis = new Redis (); $ redis-> connect ("localhost", "6379"); $ redis-> set ("say", "Hello World "); echo $ redis-> get ("say"); // output Hello World. The program runs successfully.

IV. common operations

// Set key $ redis-> set ('val1', 'ABC'); echo $ redis-> get ('val1 ').'
'; // Delete key $ redis-> del ('val1'); // return TRUE (1) var_dump ($ redis-> get ('Val ')); // return bool (false) // check whether the key exists if (! $ Redis-> exists ('key1') // var_dump ($ redis-> del ('key1') does not exist; // int (0) is returned) // Set the mset set $ array_mset = array ('First _ key' => 'first _ val ', 'second _ key' => 'second _ val ', 'third _ key' => 'third _ val '); $ redis-> mset ($ array_mset); $ array_mget = array ('First _ key ', 'Second _ key', 'third _ key'); var_dump ($ redis-> mget ($ array_mget); // returns array $ redis-> del ($ array_mget ); // Use array to delete multiple keyvar_dump ($ redis-> mget ($ array_mget) at the same time; // returns array (3) {[0] => bool (false) [1] => bool (false) [2] => bool (false )}

The above describes how to configure the redis module in XAMPP under win7, including some content. I hope my friends who are interested in the PHP Tutorial can help me.

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.