Install redis under windows and set it to start automatically on windows

Redis installation

1. First download and install Redis under Windows

Download address: https://github.com/MicrosoftArchive/redis/releases
Choose 32-bit or 64-bit according to the actual situation of your computer system, here I downloaded the Redis-x64-3.0.500.zip compressed package, compressed Then get the unzipped file.

2. Test run

Open a cmd window (run as administrator), use the cd command to switch the directory to the directory of the unzipped folder (for example: mine is D:\Program Files\Redis-x64-3.0.500), run redis-server .exe redis.windows.conf

At this time, another cmd window is opened, and the original cmd window cannot be closed, otherwise the Redis server will be closed and cannot be accessed.

Still switch to the redis directory (mine is D:\Program Files\Redis-x64-3.0.500),

Run redis-cli.exe -h 127.0.0.1 -p 6379
set key-value pair set key 123
take out key-value pair get key

Problem: But it is impractical to execute the redis-server.exe redis.windows.conf command to start the Redis service, and it should be set to start in the service.

solution:

3. Install as a Windows service - start up automatically

Open a cmd window (run as administrator), use the cd command to switch the directory to the directory of the unzipped folder (for example: mine is D:\Program Files\Redis-x64-3.0.500), run redis-server --service-install redis.windows.conf

If the installation is successful, it means that it has been used as a windows service.

Open the cmd window and enter services.msc, Redis appears in the service, and starts the service by itself.

How does PHP use redis?

click to enter

View original text

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326077831&siteId=291194637