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 The IP address to connect to. The default value is local.
-d start memcached Service
-D restart memcached Service
-d stop | Shutdown the running memcached Service
-D install the memcached Service
-D uninstall to uninstall the memcached Service
-u To (Only valid when running as root)
-m 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. The default value is 1.25.
-n Minimum allocation space. The default value of key + value + flags is 48.
-H Show Help
memcache environment test :
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!
$ 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;
?>