Windows PHP5 Installing the Redis extension

Source: Internet
Author: User
Tags redis tutorial

Recently wanted to install the Redis extension in the 5.6 version of the development environment, the results of a half-day is a broken link, hereby make a backup

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

Then, put the Php_redis.dll in the PHP ext folder

Finally in PHP.ini Plus

Extension=php_redis.dll

  

Restart the environment to run the following code, if Redis is started

$redis = new Redis (), $redis->connect (' 127.0.0.1 ', 6379), echo "Connection to Server sucessfully";//See if the service is running echo " Server is running: ". $redis->ping ();

Execute the script with the output as:

Connection to server Sucessfullyserver is Running:pong

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");

Execute the script with the output as:

Connection to server sucessfullystored string in Redis:: Redis Tutorial

Windows PHP5 Installing the Redis extension

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.