Install and configure memcache in windows _ PHP Tutorial

Source: Internet
Author: User
Install and configure memcache in windows. Here we will not talk about what memcached is and how memcached is used. readers can refer to this article on their own: What is memcached? How to use memcache? This article mainly introduces what memcached is and how memcached is used. here we will not talk about it. readers can refer to this article on their own:
What is memcached? How to use memcache?
This article describes how to install and configure the memcached service in windows.

(1) Download the memcached program (applicable to windows 32)

Download memcached-win32 version (http://code.jellycan.com/files/memcached-1.2.6-win32-bin.zip), you can also go to the official website to download, memcached official website address is http://code.jellycan.com/memcached/, find "win32 binary: memcached-1.2.6-win32-bin.zip" can be downloaded.

(2) install memcached

1. decompress the downloaded file to the c:/memcached Directory, start cmd, and run the following commands in sequence:

C:> c:/memcached/memcached.exe-d install // install memcached
C:> c:/memcached/memcached.exe-d start // start the memcached service
C:> telnet 127.0.0.1 11211 // test the connection. 11211 is the default port of the memcached service.

2. enter stats. (if the following information is displayed, memcached is successfully installed)

STAT pid 2484
Statuptime 266
STAT time 1267938148
STAT version 1.2.1
STAT pointer_size 32
STAT curr_items 0
STAT total_items 0
STAT bytes 0
STAT curr_connections 1
STAT total_connections 2
STAT connection_structures 2
STAT performance_get 0
STAT performance_set 0
STAT get_hits 0
STAT get_misses 0
STAT bytes_read 23
STAT bytes_written 7
STAT limit_maxbytes 67108864
END

Note: If you are a Windows 7 system, the message "'telnet 'is not an internal or external command or a program that can be run" may be displayed, after troubleshooting, this is because the telnet function is not installed by default in Win7, so you cannot directly use the telnet command, you can go to "control panel"> "program"> "enable or disable Windows" and check "telnet Client.

(3) configure the memcached service of php

Php_memcache.dll components: http://www.php100.com/html/download/tools/2010/0125/3858.html

Download the php_memcache.dll component, put it in the ext Directory of the php installation directory, and then add it in the PHP. ini (note that the file modified using the phpnow server is a php-apache2handler.ini) File:

Extension = php_memcache.dll;

Save and exit, restart the Apache server, and use the phpinfo () function to check whether the memcached service exists in the service.

(4) test whether the memcached service can run normally

 Connect ('1970. 0.0.1 ', 127) or die ("Memcache connection failed"); echo 'current Memcache version:'. $ mem-> getVersion ().'
'; // Get the Memcache version information $ mem-> set ('content', 'Hello world! '); // Add a Memcache object echo $ mem-> get ('content'); // Obtain a key value $ mem-> close ();

If everything above works properly, it indicates that memcached has been successfully installed and configured. Then you can use the memcached service normally.

Articles you may be interested in
  • How to install and configure the PHP runtime environment in Windows 7
  • Install and use Sphinx in windows [Chinese full-text search is supported]
  • Install memcache in windows
  • Differences between window. navigate and window. location. href
  • How to run PHP files in the command line in windows
  • Mysql installation and configuration tutorial (graphic explanation)
  • Steps for synchronizing and backing up mysql databases in windows
  • Run the doscommand in Windows to view the program that occupies Port X.

What is memory memcached and how memcached is used? I will not talk about it here. readers can refer to this article on their own: What is memcached? How to use memcache? This article mainly introduces...

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.