Many phper do not know how to build memcache under Windows Development Debugging environment, recently, individuals are also studying memcache, recording their own installation of the process. In fact, I began to study memcache did not know incredibly still have memcached for Win32 this bird thing, harm I cnetos under the 1 days to fix, today suddenly found under Windows Memcache to develop debugging completely no problem, So write a memcache document to share with everyone.
memcache installation under Windows:
1. Download Memcache's Windows stable version and unzip it under a disk, for example, in c:\memcached
2. Enter the ' c:\memcached\memcached.exe-d install ' installation in the terminal (also known as the cmd Command interface)
3. Re-enter: ' c:\memcached\memcached.exe-d start ' starts. Note: memcached will start automatically every time a service is turned on for Windows. This way the server side is already installed.
4. Download Php_memcache.dll, please find the corresponding PHP version of the file yourself
5. Add a line of ' Extension=php_memcache.dll ' to C:\winnt\php.ini
6. Restart Apache, then check the phpinfo, if there is memcache, then the installation is successful!
Basic settings for memcached:
-P Listening Port
-L connected IP address, default is native
- D start memcached service
- d Restart Restart memcached service
-D Stop|shutdown Close the running memcached service
- D install memcached service
- D Uninstall uninstall memcached service
-U Run as (only valid when running as root)
-m maximum memory usage, in megabytes. Default 64MB
-M running out of memory and returning an error instead of deleting an item
-C Maximum number of simultaneous connections, default is 1024x768
-F Block size growth factor, default is 1.25
-N Minimum allocated space, key+value+flags default is
- h Display Help
memcache Environmental Testing:
run the following PHP file, if there is output this is a test!, it indicates that the environment was built successfully. Begin 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, $);
$val = $mem->get (' key ');
echo $val;
?>