Win2008 R2 64Bit IIS environments install Memcache and memcached server-side methods _win servers

Source: Internet
Author: User
Tags memcached memory usage

If the iis+php environment requires memcache cache support. Need to install the server side and the client!

One, install memcached service end

1, first download the memcached server, the following download address contains 32 and 64, you can refer to their own system to download:

Download Address:
Baidu Network disk: http://pan.baidu.com/s/1ntyswWh Password: mf6a
Http://pan.baidu.com/s/1dE2EG4T

This is the version under Windows that installs to be installed at the command line
Extract to C disk or other disk can be, such as my is D disk memcached directory, and then enter the cmd command line, as follows:

Microsoft Windows [version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\administrator>d:

d:\>cd memcache144

d:\memcached144>memcached.exe-d Install (installed as service)
d:\memcached144>memcached.exe-d start (start)
c:\memcached44>

This allows you to see the memcache.exe process inside the process. This will start automatically every time you start

Memcached There are some other commonly used commands as follows:

Copy Code code as follows:

-P Listening Port
The IP address of the-l connection, the default is native
-D Start memcached service
-D Restart Restart memcached service
-D Stop|shutdown shut down the running memcached service
-D Install installation memcached service
-d Uninstall Uninstall memcached service
-U Run as (only valid when run as root)
-m maximum memory usage, in MB. Default 64MB
-Returns an error when M memory is exhausted instead of deleting the item
-C Maximum Simultaneous connection number, default is 1024
-F Block size growth factor, default is 1.25
-N Minimum allocation space, key+value+flags default is 48
-H Display Help

Following the installation steps above, the use of memcached-m 200来 to adjust the maximum memory footprint will be found to have no effect, always the default 64MB of memory, search on the Internet, because the registry does not write information, you can modify this.

1. memcached-d shutdown first closes the memcached service.

2. Enter the registration form and find

Hkey_local_machine\system\currentcontrolset\services\memcached Server

In which there is a ImagePath entry, the value is "D:\memcached144\memcached.exe"-D runservice, followed by

-P 11211-l 127.0.0.1-m 256-c 2048

Second, install Memcache client

2. Download the PHP version corresponding to the Php_memcache.dll (the PHP version I use here is: Php-5.4.15-nts-win32-vc9-x86.zip)
Download Address:

Official address: Http://pecl.php.net/package/memcache/3.0.8/windows

Then unzip, copy inside the Php_memcache.dll to your PHP ext directory, like mine is
"D:\php\ext" directory, for PHP loading Php_memcache.dll

3. Configure PHP.ini
In the PHP configuration file: Add the following code at the bottom of the php.ini:

[Memcache]
Extension = Php_memcache.dll

4. Restart IIS, and then look at the phpinfo, if there is memcache, then the installation is successful!
Test:

<?php
$mem = new Memcache;
$mem->connect ("127.0.0.1", 11211);
$mem->set (' key ', ' This is a test! ', 0);
$val = $mem->get (' key ');
echo $val;
? >

Iii. Memcached management and monitoring tools

1.MemAdmin
Download Address:
Baidu Cloud Disk: Http://pan.baidu.com/s/1hquyMCO Password: 46BK
Http://pan.baidu.com/s/1o8zUIYA
Official Download: http://www.junopen.com/memadmin/

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.