Windows PHP doitphp Framework memcache cache is turned on.

Source: Internet
Author: User

<-> 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.