Requirements
What is a PHP Redis
PHP Redis is a C-language PHP module used to connect and manipulate data on a Redis database.
Download
- Download Address: Https://github.com/phpredis/phpredis/downloads
We need to pay attention to the version number, according to personal circumstances, I was php_redis-5.3-vc9-ts-73d99c3e.zip
Use the Phpinfo () function to view information about the current PHP version
Install extensions
Unzip the downloaded compressed package and copy the *.dll module to the PHP ext folder. 5.3 of packages contain only php_redis.dll modules, while 5.4 contain Php_redis.dll and Php_igbinary.dll two modules.
To modify the php.ini file:
The 5.3 package introduces the following code
The 5.4 package introduces the following two modules:
Ps:extension=php_igbinary.dll must be placed in front of the extension=php_redis.dll, otherwise this extension will not take effect
Test
Restart the Web server.
Enter the following code in the redis.php file:
PHP$redisnew Redis (); $redis->connect ("localhost", "6379"); $redis->set ("string", "Hello World"); Echo $redis->get ("string");? >
To test in a browser, it is important to note that the Reids service must be in the boot state. For the installation of Redis on the Windows platform, you can refer to an article I wrote earlier.
If the above articles or links are helpful to you, don't forget to click the "OK" button at the end of the article or click the "like a " button in the bottom right corner of the page. You can also click on the right side of the page " share " hover button Oh, let more people read this article.
Author: Li-cheng
Weibo: http://weibo.com/licheng0426
Source: http://www.cnblogs.com/Li-Cheng/p/4391337.html
Due to my limited level, the article in terms of presentation and code if there is something wrong, welcome criticism. Leave your footprints, welcome to comment Oh. You can also pay attention to me, study together Oh!
(^_^) If you think this article is helpful to you, let's enjoy a coffee bar, what's The DA (^_^)
The above describes the Windwos platform installation Phpredis module, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.