Installing Redis Extensions for PHP under Windows

Source: Internet
Author: User
Tags phpinfo install redis redis tutorial

1. Use the Phpinfo () function to view PHP version information, which will determine the extension file version.

2. Download Php_igbinary-2.0.1-7.0-ts-vc14-x64.zip,php_redis-3.1.3rc2-7.0-ts-vc14-x64.zip (be sure to make sure the version is correct)

: "Select the appropriate version"

http://windows.php.net/downloads/pecl/snaps/redis/

http://windows.php.net/downloads/pecl/releases/igbinary/

PS: If you see Php7ts.dll in the PHP directory, select the TS version

3. After decompression, copy the Php_redis.dll and php_redis.pdb to the PHP ext directory

4. Modify the PHP.ini, (PS: This php.ini file is in the Apache directory) to include in the file:

; Php_redis

Extension=php_igbinary.dll

Extension=php_redis.dll

Note: Extension=php_igbinary.dll must be placed in front of extension=php_redis.dll, otherwise this extension will not take effect

5. After restarting Apache, use Phpinfo to see if the extension was installed successfully

6. After you open the Redis service, you can test whether it can be called with the following.

<?php  //Connect the local Redis service  $redis = new Redis ();  $redis->connect (' 127.0.0.1 ', 6379); echo "Connection to Server sucessfully";  Set up Redis string data  $redis->set ("Tutorial-name", "Redis Tutorial");  Get the stored data and output  echo "Stored string in Redis::". $redis->get ("Tutorial-name");?>

PS: The local Redis service must be turned on before running ": Https://redis.io/download"

In fact, Redis can be installed as a Windows service, boot from boot, the command is as follows:

Redis-server--service-install redis.windows.conf

Once installed, you can see that Redis is already a Windows service:

But after the installation, Redis did not start,

The start command is as follows:

Redis-server--service-start

Stop command:

Redis-server--service-stop

You can also install multiple instances

Redis-server--service-install–service-name redisservice1–port 10001redis-server--service-start–service-name Redisservice1redis-server--service-install–service-name redisservice2–port 10002redis-server--service-start– Service-name redisservice2redis-server--service-install–service-name redisservice3–port 10003redis-server-- Service-start–service-name RedisService3

Uninstall command:

Redis-server--service-uninstall

Installing Redis Extensions for PHP 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.