ThinkPHP3.2.3 using Memcache cache under Windows

Source: Internet
Author: User

Get ready

To use Memcache, first install the configuration memcache service memcached:

Download http://downloads.northscale.com/memcached-win64-1.4.4-14.zip, click EXE file after decompression to start the service;

then download the corresponding version of PHP memcache extension file Http://windows.php.net/downloads/pecl/releases/memcache/php_memcache.dll to the PHP installation directory to expand the directory Php\ext;

Finally, modify php.ini to join this line extension=php_memcache.dll restart Apache after the Phpinfo search to see if there is a memcache module that indicates that the installation was successful and can be used.

Use of memcache in thinkphp

In the new 3.2.3, you only need to configure the data cache type to use Memcache:

' Data_cache_type ' = ' Memcache ',//data cache type

Test

With the caching S method, you can set the cache and fetch cache values:

S (' Test ', ' Hello Memcache ');

$mem _test = S (' test ');

echo $mem _test; Output Hello Memcache indicates success

ThinkPHP3.2.3 using Memcache cache under Windows

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.