1. What is memcached?
Memcache is a high-performance distributed memory object caching system that can be used to store data in a variety of formats, including images, videos, files, and database retrieval results. The use of Memcache website general traffic is relatively large, in order to alleviate the pressure of the database, let Memcache as a cache area, the part of the information stored in memory, in the front-end can be quickly accessed.
2. Installation of memcache on Windows platform
(1) Download memcached 1.2.4
(2) Unzip to the custom directory. such as (D:\memcached)
(3) Open DOS, enter the following command
D:\memcached\memcached.exe-d Install
(4) Re-enter
D:\memcached\memcached.exe-d start
Start. Memcached will start automatically every time a service is turned on for Windows.
(5) D:\memcached\memcached.exe-h Display Help, get the use of various commands
3. Installation of Memcache Win32 and configuration in PHP
(1) Download: Php_memcache.dll components (Wamp, since Php_memcache is a third-party extension, so the original PHP is not self-brought, can be downloaded to the official website)
(2) Copy Php_memcache.dll to the specified component directory, default in php\ext\
(3) Add a sentence in php.ini: Extension=php_memcache.dll
(4) Restart the Web service and use the Phpinfo () function to view the enabled condition
4. Connect Memcache with PHP
$mem = new memcache;//Initializes an instance of $mem->connect (' 127.0.0.1 ', 11211) or Die ("Connection Failed");//connection server address and default port $version = $mem GetVersion ();//Get version information echo $version;