How to configure the memcached environment in windows

Source: Internet
Author: User

Memcached is a database cache acceleration function. It can be used on many platforms, such as windows and linux. The following describes how to configure memcached in windows.

Install Memcache in Windows

1. Download memcache for windows. : Http://jehiah.cz/projects/memcached-win32. we recommend downloading binaries and decompress it (in this example, decompress it to c: memcached ).

2. In the command line status, enter:

C:/memcached/memcached.exe-d install

So far, memcached has been installed as a windows service.

3. Enter:


C:/memcached/memcached.exe-d start

To start the memcached service. Of course, you can also choose to start in windows Service

You are not mistaken. It is so simple that the server end of the simple three-step memcache is ready.
Install Memcached module in php

1. Download The php_memcache.dll module. You can find the corresponding version from http://downloads.php.net/pierre,
Php5.3 direct download http://shikii.net/blog/downloads/php_memcache-cvs-20090703-5.3-VC6-x86.zip

2. Modify php. ini and add the following content:


Extension = php_memcache.dll

3. Restart the apache server and check phpinfo. If memcache exists, the installation is successful!
Test Memcached in windows

The test code is as follows:

<? Php
$ Mem = new Memcache;
$ Mem-> connect ("127.0.0.1", 11211 );
$ Mem-> set ('key', 'Hello Memcached! ', 0, 60 );
$ Val = $ mem-> get ('key ');
Echo $ val;

For more test code, see the following steps:

Http://www.php.net/manual/en/memcache.examples-overview.php

Basic settings of Memcached

-P listening port
-L connected IP address. The default value is local
-D start: start the memcached service.
-D restart: restart the memcached service.
-D stop | shutdown the running memcached Service
-D install the memcached Service
-D uninstall memcached Service
-U runs as the identity (only valid when running as root)
-MB maximum memory usage, in MB. The default value is 64 MB.
-An error is returned when M memory is used up, instead of deleting items.
-C: Maximum number of simultaneous connections. The default value is 1024.
-F block size growth factor, default value: 1.25
-N: minimum allocation space. The default value of key + value + flags is 48.
-H Show Help

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.