Home > Backend Development > PHP Tutorial > wamp extends redis under window

wamp extends redis under window

WBOY
Release: 2016-08-08 09:32:05
Original
753 people have browsed it

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
Copy after login

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');
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template