<-> first need to install Memcache server
Win7 64-bit: Http://files.cnblogs.com/bin-pureLife/memcached-win64.rar
Install, open.
< two > Modify php.ini
Extension=php_memcache.dll (remove the preceding semicolon and open the cache extension)
Note: The Php_memcache.dll version in the extension library must be the same or it will be an error
Various versions of DLLs available for download: Http://files.cnblogs.com/bin-pureLife/memcache_dll.rar
Restart Apache or another application server
< three > Success Logo:
Both services open at the same time;
< four > config file configuration in doit project: define (' MEMCACHE ', true); If TODO uses memcache, it is turned off by default.
Global configuration:
if(MEMCACHE) {$memOptions=Array ('Servers'=Array (Array ('Host'='127.0.0.1','Port'=11211,'Persistent'=true,'Weight'=1,'Timeout'= -) ), 'Compressed'=true, 'expire'=3600, 'Persistent'=true, ); $GLOBALS ['memcache'] =NewCache_memcache ($memOptions);}
< five > test code
$memcache = $GLOBALS ['memcache']; if(! $memcacheGet('Test') {$model= $ This->model ('Edu'); $res= $modelFindAll (); $memcache-Set('Test', $res); } var_dump ($memcache-Get('Test')));
normal indicates OK.
Windows PHP doitphp Framework memcache cache is turned on.