Install memcache in Windows

Source: Internet
Author: User

Many phper do not know how to set up a memcache development and debugging environment in windows. Recently, I am also studying memcache and recording the process of self-installation.
In fact, when I started to study memcache, I didn't know that there was a memcached for Win32 bird thing, which caused me to be able to handle it in a one-day way in the case of Cen-tos, today, I suddenly found that there is no problem in developing and debugging memcache in windows, so I wrote a memcache document to share with you.

Install memcache in Windows:
1. Download the stable version of memcache for Windows and decompress it to a disk, for example, in c: \ memcached
2. Enter 'C: \ memcached \ memcached.exe-D install' on the terminal (that is, the CMD command interface) to install
3. Enter 'C: \ memcached \ memcached.exe-D start' to start. Note: in the future, memcached will be used as a Windows Service and will be automatically started every time it is started. In this way, the server has been installed.
4. Download php_memcache.dll. Find the corresponding PHP version file by yourself.
5. Add a line 'extension = php_memcache.dll 'to c: \ winnt \ PHP. ini'
6. Restart Apache and check phpinfo. If memcache exists, the installation is successful!
 

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

Test the memcache Environment:
Run the following PHP file. If this is a test! Is output !, Indicates that the environment is successfully set up. Start to appreciate the charm of memcache!
<? PHP
$ Mem = new memcache;
$ Mem-> connect ("127.0.0.1", 11211 );
$ Mem-> set ('key', 'This is a test! ', 0, 60 );
$ Val = $ mem-> get ('key ');
Echo $ val;
?>

References:
If you have any questions about memcached, refer to the following articles:
Install memcache in Linux: http://www.ccvita.com/257.html
Windows memcache installation: http://www.ccvita.com/258.html
Memcache basic Tutorial: http://www.ccvita.com/259.html
Discuz! Memcache cache implementation: http://www.ccvita.com/261.html
Memcache protocol (http://www.ccvita.com/306.html)
Memcache distributed deployment scheme: http://www.ccvita.com/395.html

Tag: memcache, Windows

Kimi at 2007-12-08 16:24:01 in memcache

Copyright statement: original works. You are welcome to reprint them.HyperlinkIndicate the original address, author information, and the statement.

 

Http://www.ccvita.com/258.html

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.