In recent projects, some data needs to be cached using memcache to reduce the number of queries to the database. This article documented the installation and simple testing process for memcache, and the installation memcache includes two steps, namely memcached installation and memcache PHP extension installation.
First, install Memcached server:
1, download window under the Memcached server, connection address: Http://www.2cto.com/uploadfile/2012/0713/20120713110308123.zip
2, unzip the downloaded file to a certain path, such as: D:\wamp64\bin\memcached\memcached.exe
3, Install window service in cmd command Fuding (WIN10 requires Administrator privileges):
Memcached.exe-d Install can be
4, Start memcache service:
memcache.exe-d start
5, open the Windows service service.msc see if there are any memcached in the service, if a representative service is successfully opened
Ii. Installing PHP extensions under Windows
1, download the PHP version corresponding to the memcache extension (note: Do not know their PHP version can use the Echo phpinfo () view)
Extended Download Address: Http://pecl.php.net/package/memcache/3.0.8/windows, this address contains versions of all versions of PHP's Memcache extensions.
2, put the extracted php_memcache.dll into PHP's ext folder
3, open php.ini Add the following line: Extension=php_memcache.dll
4, restart the Apache server (note: If it is wamp under Apache must change Apache under PHP.ini, and then PHP php.ini add Invalid)
Third, testing
Under Windows command line, view memcache, turn on Telnet 127.0.0.1 11211
As shown in figure:
Reference: http://blog.163.com/sun_jian_zhang/blog/static/1878040412013102610415184/
http://tieba.baidu.com/p/3789588439