Redis services and their configuration and Applications (window environment)

Source: Internet
Author: User
Tags redis windows redis server

I. Introduction of Redis:
is redis an open source use of ANSI? C language Writing, support network, can be based on memory and persistent log-type,key-value database , and provide a variety of language API (from Baidu Encyclopedia), individuals prefer the following explanation: instead of focusing on the problem of how to put an elephant in a refrigerator, we don't have to work with a monotonous database, using Redis Flexible data structures and data manipulation to build different refrigerators for different elephants .

?

?

Second, Redis installation:

First download the Redis package, according to the properties of their own computer operating system select X86 or X64 version, extracted to the specified directory, such as: C:\software\redis-2.4.5\ ,

Enter the directory, hold down the SHIFT key, right-click in the directory blank, select "Open Command Window Here", open the DOS window, and the path is the current directory, as shown in:

?

Execute the following command in the current directory: Redis-server.exe redis.conf (Verify that there are two files in the current directory before running)

?

The following window shows that the installation was successful,

?

In the current directory, reopen a DOS window, run? redis-cli.exe-h 127.0.0.1-p 6379, where 127.0.0.1 is the local ip,6379 is the default port on the Redis server. The run succeeds as shown in.

?

?

In this way, the build of the Redis Windows environment is complete.

?

Third, Redis Boot and window stealth settings:

1. Write the start command to bat. As follows:

?

D:\software\redis-2.4.5\redis-server.exe? D:\software\redis-2.4.5\redis.conf saved as Start_redis.bat----I put the file in that directory as well;

?

2, use VBS to invoke bat.

?

New VBS file OPENREDIS.VBS. Write command:


CreateObject ("Wscript.Shell"). Run "cmd/c D:\software\redis-2.4.5\start_redis.bat", 0

Here's how to call VBS.

?

Method One: Program calls, code as follows

?

ProcessStartInfo startinfo = new ProcessStartInfo ();

Startinfo.filename = "Wscript.exe";

startinfo.arguments = "d:\\software\\redis-2.4.5\\openredis.vbs";

Process.Start (StartInfo);

?

Method Two: Set boot auto start
In the registry key value

"HKEY_CURRENT_USER \software \microsoft \ Windows \CurrentVersion \run"

New string value Openredis, fill in the corresponding file location D:\software\redis-2.4.5\openredis.vbs, Note: If the path contains spaces, etc., to add quotation marks

To enable the boot automatically start Redis.?

?

Iv. adding Redis extensions to PHP:

?

1, download the corresponding version of PHP extension binaries, that is, the. dll file, such as my native is 64-bit, PHP version 5.5.1, hit the phpinfo to see the specific required version:

?

Then use the TS,VC11 version, such as the version that I downloaded:

?

I used the ts,64 bit, vc11.

?

2. Copy the two DLL files from the two directories in the TS directory to the EXT directory under the PHP installation directory,

?

3. Configure the php.ini file to add extensions

Method One: Manually configure----for Apache server and IIS server??

Open the php.ini file and add the extension configuration entry in the file:

[Php_igbinary]

Extension=php_igbinary.dll

[Php_redis]

Extension=php_redis.dll

Note:php_igbinary.dll extension must be in front of php_redis.dll, otherwise it will not take effect;

Method Two: IIS is automatically set up and can be used only on IIS servers

Open Internet Information Services (IIS) explorer and click into the PHP Manager interface to

Add extensions or activate, close these extensions here (if you add an extension here you don't need a second step).

Redis services and their configuration and Applications (window environment)

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.