1. To use PHP to connect to the memcached server, you need to introduce the corresponding Php-memcache.dll extension, you need to note that in Windows to find the corresponding DLL extension to be very cautious, generally consider the following points: (see PHPINFO)
1. PHP version
2, TS or NTS (thread safety or unsafe)
3, compile is VC6 or VC9
I have chosen this version:
http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8E/A9/wKioL1jIucPRvd7oAACtBztAyCo683.png-wh_500x0-wm_ 3-wmp_4-s_4273698136.png "title=" qq picture 20170315114701.png "alt=" Wkiol1jiucprvd7oaactbztayco683.png-wh_50 "/>
Then put the inside of the Php_memcache.dll into the Php/ext, and in the corresponding server PHP.ini configuration (F:\wamp\bin\apache\Apache2.4.4\bin\php.ini) to join EXTENSION=PHP_ Memcache.dll. Restart the server.
2. Download the Memcache service
Http://vdisk.weibo.com/s/dwoxtoBQDYzjm
Execute it in the Memcache.exe path in cmd, I put it on the D drive.
Memcached-m 64-p 11211-VVV
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8E/A9/wKioL1jIuqui0sqLAAFlXf3UP8Y785.png-wh_500x0-wm_ 3-wmp_4-s_1241856577.png "title=" qq picture 20170315115014.png "alt=" Wkiol1jiuqui0sqlaaflxf3up8y785.png-wh_50 "/>
3. Test Memcache
http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/
The files downloaded in this address are also available as examples for testing
<?php
/**
* @file test11.php
* @author Linlin
* @date March 14, 2017 2:56:21
* @brief
*/
/* echo phpinfo (); exit; */
$memcache = Memcache_connect (' localhost ', 11211);
if ($memcache) {
$memcache->set ("Str_key", "String to store in memcached");
$memcache->set ("Num_key", 123);
$object = new StdClass;
$object->attribute = ' Test ';
$memcache->set ("Obj_key", $object);
$array = Array (' Assoc ' =>123, 345, 567);
$memcache->set ("Arr_key", $array);
Var_dump ($memcache->get (' Str_key '));
Var_dump ($memcache->get (' Num_key '));
Var_dump ($memcache->get (' Obj_key '));
Var_dump ($memcache->get (' Arr_key '));
}
else {
echo "Connection to memcached failed";
}
Final Test success
This article is from "The only way to program" blog, please be sure to keep this source http://linlin2017.blog.51cto.com/8346821/1906780
Installing Memcache extensions for PHP5.6.14 under Windows 64-bit