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