Download memcache for windows (DLL) from https://pecl.php.net/package/memcache
Extract the files (php_memcache.dll & php_memcache.pdb) and put in <drive>\wamp\bin\php\phpx.x.xx\ext
Update php.ini file with extension=php_memcache.dll (run test page with phpinfo and check “Loaded Configuration File” for php.ini configuration file )
Run following script to test memcache
$memcache = new Memcache; $memcache->connect('localhost', 11211) or die ("Could not connect"); $version = $memcache->getVersion(); echo "Server's version: ".$version."<br/>\n"; $tmp_object = new stdClass; $tmp_object->str_attr = 'test'; $tmp_object->int_attr = 123; $memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server"); echo "Store data in the cache (data will expire in 10 seconds)<br/>\n"; $get_result = $memcache->get('key'); echo "Data from the cache:<br/>\n"; var_dump($get_result);
Output:
Server's version: 1.4.4-14-g9c660c0 Store data in the cache (data will expire in 10 seconds) Data from the cache: E:\Websites\httpdocs\index.php:43: object(stdClass)[3] public 'str_attr' => string 'test' (length=4) public 'int_attr' => int 123