Memcache and PHP on IIS - HowTo
Posted by admin on July 15 2013 17:41:01
1. download memcache file from here
   http://downloads.php.net/pierre/php_memcache-2.2.6-5.3-nts-vc9-x86.zip
   
2. copy dll to the php/ext folder

3. edit the php.ini file with the following changes under Dynamic Extensions section
   extension = php_memcache.dll
   
4. restart iis.

5. confirm it is running by doing the following test...
Write in some php file the lines bellow.
Run it. using IIS, if the script print the text:
"some really big variable", then the test is passed.


<?php

$memcache_obj = new Memcache;
$memcache_obj->connect('memcachehostexample.com', 11211);

/*
set value of item with key 'var_key', using on-the-fly compression
expire time is 50 seconds
*/
$memcache_obj->set('var_key', 'some really big variable', MEMCACHE_COMPRESSED, 50);

echo $memcache_obj->get('var_key');

?>