Installing the PHP Extended Redis (Windows environment)

Source: Internet
Author: User
Tags phpinfo redis download

First of all, thank you for supporting the open source sharing of the predecessors, resources are really too rich, although there are many excellent foreign resources by the wall ...

The first step to adding Redis extensions to PHP is to know the PHP version you're using and some of the configurations. View Phpinfo, which is important to download the corresponding DLL extension file!

Understanding this information, and then go to the Internet to find the installation of Redis download resources, this is a difficult process, to find the resources that meet the configuration is really not easy.

Resource link: https://github.com/dmajkic/redis/downloads Download the folder where you can find a directory to begin with after you unzip it

There should be these files.

Then use the cmd command line to enter this directory: cd your directory absolute path

Input command: Redis-server.exe redis.conf If the real effect succeeds.

Do not close this window after success because the Reids program is running, open another CMD window to the installation Redis directory, which is the first directory.

Input command: redis-cli.exe-h 127.0.0.1-p 6379 This goes to the Redis client, which is the server

Successful entry is displayed

Then test the Redis key-value storage effect. Input command: Set test22 "Xionghao" "Enter

Get test22 Enter

Effect

Use in PHP also to download the Redis extension file, according to the information displayed by phpinfo to download the corresponding resources

Resources Link: http://download.csdn.net/download/bluesky321/5355093 pity to Point

Http://pecl.php.net/package/redis/2.2.7/windows

After download, unzip the Php_redis.dll file into the PHP ext folder, while corresponding to modify the php.ini

Add Extension=php_redis.dll to PHP.ini

Another argument is to first put Php_redis.dll and php_igbinary.dll into the PHP ext folder, and then add the following code in the php.ini configuration file:

Extension=php_igbinary.dll

Extension=php_redis.dll

But I downloaded the DLL file there is no php_igbinary.dll, but still so ... I guess that's why the PHP version is different.

Finally restart the Apache server again open phpinfo ctrl+f search Redis

The extension was successfully installed.

Write a php file to test it:

$redis = new Redis ();
$redis->connect (' 127.0.0.1 ', 6379);
$redis->set (' Test ', ' Hello Redis ');
echo $redis->get (' Test ');

Installing the PHP Extended Redis (Windows 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.