Home  >  Article  >  Backend Development  >  wamp extends redis under window

wamp extends redis under window

WBOY
WBOYOriginal
2016-08-08 09:32:05683browse

I use the redis function at work and need to expand it. I checked some information on the Internet and made records myself

https://github.com/nicolasff/phpredis/downloads

Go to this place to download and you can find yourself The corresponding versions, the first two are 32-bit and 64-bit, because my local PHP version is 5.2 and uses the third compressed package. Open the corresponding dll and restart apache. Remember to update php/php.ini and apache/php.ini simultaneously

You must run the redis service before testing in the php file. The following file content is compressed in the first and second

Double-click redis-server.exe in the installation directory to start the redis cache service.
Double-click redis-cli.exe in the installation directory to open the cache client.

You can put these two startup operations into the file and modify it to automatically run bat

start "redis-server" /min cmd /c redis-server D:\redis\redis.conf
start "redis-client" /min cmd /c redis-cli

After running the redis service, you can run the php program to test

$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','helloworld!');
echo $redis->get('test');

The above introduces the wamp extension redis under the window, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:ubuntu compile nginxNext article:ubuntu compile nginx