In fact, I began to study memcache when I did not know incredibly there are memcached for Win32 this bird thing, I was in Cnetos under the toss 1 days to fix, and today suddenly found that Windows under the Memcache to develop and debug completely no problem, So write a memcache document to share with you.
memcache installation under Windows :
1. Download the memcache Windows stable version, extract and put under a certain disk, such as in c:\memcached
2. Enter ' c:\memcached\memcached.exe-d install ' installation at terminal (also known as cmd Command interface)
3. Re-enter: ' c:\memcached\memcached.exe-d start ' start. Note: Later memcached will start automatically every time a service is powered on as windows. This way the server side is already installed.
4. Download Php_memcache.dll, please find the corresponding PHP version of the file
5. Join a line of ' Extension=php_memcache.dll ' in C:\winnt\php.ini
6. Restart Apache, then check phpinfo, if there is memcache, then the installation is successful!
basic settings for memcached :
-P The IP address of the port
-L connection that is listening, by default, the native
-D start memcached service
- d Restart memcached Service
-D stop|shutdown shutdown running memcached service
-d install install memcached service
-D Uninstall Uninstall the memcached service
-u to run as (valid only when running as root)
-M Maximum memory usage, in MB. Default 64MB
-M is running out of memory and not deleted
-C Maximum number of simultaneous connections, default is 1024
-f Block size growth factor, default is 1.25
-n minimum allocation space, key+value+flags default is the
-h display Help
< /blockquote>
memcache Environment Test :
runs the following PHP file, which indicates that the environment has been built successfully if there is a test! output. 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;
?