Windows under Redis Compilation installation

Source: Internet
Author: User
Tags download redis phpinfo

Redis is now more popular NoSQL, mainstream large sites are used more, many students do not know how to install, here is introduced in Windows installation and extension, provide learning to use, the actual use of the environment more under Linux.

First download Redis on the appropriate website:

Unzip to any disk after download is complete such as: D:/redis

Inside includes:.

Redis-server.exe: Service Program

Redis-check-dump.exe: Local Database check

Redis-check-aof.exe: Update log check

Redis-benchmark.exe: Performance test to simulate the simultaneous sending of M-Sets/gets queries by n clients (similar to the Apache AB tool).

Of course, also need a: redis.conf (specific content on-line random search will have)

  1. To start Redis:

    Enter the root directory of Redis with the cmd command,

    Input command: Redis-server.exe redis.conf

    After startup:

    Start the cmd window to remain open, and the Redis service shuts down when it is closed.

  2. 3

    When the service is opened, another window is opened, and the client is set up:

    Input command: redis-cli.exe-h 192.168.2.168-p 6379 (this IP is self-setting, 6379 is the Redis default port)

    After input:

  3. 4

    Installing the Redis Extension

    First, look at the PHP compiled version v6/v9 in Phpinfo ()

  4. 5

    Go to the appropriate website to download the Redis extension:

    Download the corresponding version of the Redis extension

  5. 6

    Place the downloaded Php_redis.dll in the PHP extension directory (EXT) and modify the configuration file php.ini

    When adding extensions, be sure to

    Extension=php_igbinary.dll

    Extension=php_redis.dll

    This order

  6. 7

    Restart the service, view Phpinfo (), appear to indicate success;

  7. 8

    PHP code test

         $redis = new Redis ();  

        $redis->connect ("192.168.138.2", "6379"),  //php client-set IP and port  

       / /store a value  

        $redis->set ("Say", "Hello World"),  

        echo $redis->get ( "Say");    //should output Hello World  

          

       //store multiple values  

      & nbsp $array = Array (' first_key ' = ' first_val ',  

                  ' Second_key ' =& gt; ' Second_val ',  

                  ' third_key ' = ' third_val ');  

        $array _get = Array (' First_key ', ' second_key ', ' Third_key ');  

        $ Redis->mset ($array);  

        Var_dump ($redis->mget ($array _get);  

    end

Redis compilation installation 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.