PHP Builds redis on window

Source: Internet
Author: User
Tags install redis redis server

There are two ways to build a Redis: 1 to build services on Windows, which is to install Redis on Windows. 2 redis application to build PHP

1. Install Redis on Windows

Download the Redis, copy to a directory, switch to the specified installation location on the command line, run Redis-server.exe redis.conf

  

Redis server has been installed successfully!

Remember: This command window cannot be closed, then start another command window again, switch to the Redis installation directory, run Redis-cli.exe-h 127.0.0.1-p 6379, where 127.0.0.1 is the local IP, 6379 is the default port on the Redis server. Then perform the appropriate tests.

2. Building a Redis application for PHP

Put the downloaded Php_redis.dll module in the PHP installation directory/ext/, in php.ini; Extension=php_redis.dll before Extension=php_bz2.dll

Test code

1 <? PHP 2     $redis New Redis (); 3     $redis->connect (' 127.0.0.1 ', 6379); 4     $redis->set (' Test ', ' Hello Redis '); 5     Echo $redis->get (' Test '); 6 ?>

Note: The DOS command window that launches Redis cannot be turned off, otherwise clients such as PHP cannot use Redis.

PHP Builds redis on window

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.