Installing Redis under Windows

Source: Internet
Author: User
Tags download redis php website redis server

Environment: Windows7 x64 Apache2.4 PHP5.6 mysql5.5

Raw materials: Redis plug-in and Redis server software

: Redis plugin Http://windows.php.net/downloads/pecl/releases/redis/2.2.7/php_redis-2.2.7-5.6-ts-vc11-x64.zip

We can also download the corresponding PHP version of the Redis plugin according to our own needs.

First go to the PHP website

Www.php.net-> Select Downloads-> in the page that appears, select one of the Windows downloads-> appear in the page that you chose to make pecl for Windows block pecl Extensions

The new page that appears, select Download statistics-> on the page that appears to find Redis, and then click on the page that appears after clicking on the link, choose DLL link in the page that appears, select the corresponding version of the

Redis Extensions

After downloading, get a zip package, unzip it, and put it in. DLL files to the Ext folder under the PHP installation directory

Extension has been obtained, next we download Redis Server Software

: Https://github.com/dmajkic/redis/downloads

I just downloaded the 2.2.7 plugin, so the server I choose now must be greater than 2.2.7, but given the compatibility of the version, I used the 2.2.12 Version of the server

Get a ZIP package, unzip to get two versions of the Server software, I use x64, and change the folder name to Redis

Let the Redis server run, open the Windows CMD window, and switch to the Redis directory.


After the test is successful, we will link the PHP program

The first step is to add the extension of the module to the php.ini

Extension=php_igbinary.dll

Extension=php_redis.dll

Then save and restart the Apache server

Then write a test code test

<?php

$redis = new Redis ();

$redis->connect (' 127.0.0.1 ', 6379);

$redis->set (' string ', ' Hello Redis ');

echo $redis->get (' string ');

?>

If you want to test successfully, you must ensure that the command-line window running Redis is still open, that is, the Redis service is still running before it can be successfully tested or failed!

Installing Redis 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.