Examples of usages of memcache in thinkphp, thinkphpmemcache_php tutorial

Source: Internet
Author: User

Examples of usages of memcache in thinkphp, Thinkphpmemcache


The examples in this paper describe the use of memcache in thinkphp. Share to everyone for your reference. The specific analysis is as follows:

1. Download and install Memcache

Install Memcache under ①window. Download Memcached.exe to D:/memcached/memcached.exe. Run the cmd input d:/memcached/memcached.exe-d install.

② run d:/memcached/memcached.exe-d start start memcache

③ download Php_memcache.dll to the PHP installation directory extension directory Php\ext

④ Modify php.ini Add Extension=php_memcache.dll to restart Apache. View phpinfo.php If there is a memcache module, the installation is successful

2, the use of memcache in thinkphp

①thinkphp/conf/convention.php Modifying the cache type
Copy the code as follows: ' Data_cache_type ' = ' Memcache ',//data cache type,

Support: file| db| apc| memcache| shmop| sqlite| xcache| apachenote| Eaccelerator

②thinkphp official Download extension thinkphp_extend_3.1.2/extend/driver/cache/cachememcache.class.php save to thinkphp/lib/driver/cache/ CacheMemcache.class.php

③ Test: Copy Code code as follows: S (' Test ', ' memcache '); $test = s (' Test '); Echo $test;

The output memcache test was successful.

It is hoped that this article will be helpful to everyone's thinkphp framework design.

http://www.bkjia.com/PHPjc/919625.html www.bkjia.com true http://www.bkjia.com/PHPjc/919625.html techarticle example of memcache usage in thinkphp, Thinkphpmemcache This article describes the use of memcache in thinkphp. Share to everyone for your reference. The specific analysis is as follows: 1, download and install ...

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