thinkphp Memcache Cache Usage Example

Source: Internet
Author: User
about thinkphp usage in memcache, including memcache installation, how to run it in thinkphp, thinkphp In Memcache as an example of caching, a friend is required to refer to the below. !--ad-->!--ad--end-->

thinkphp memcache Cache usage

1, download and install Memcache 1), window to install the memcache. Download Memcached.exe to D:/memcached/memcached.exe. On the run cmd input: d:/memcached/memcached.exe-d install installation. 2), run d:/memcached/memcached.exe-d start memcache3), download Php_memcache.dll to the PHP installation directory extension directory PHP\EXT4), modify php.ini Join Extension=php_memcache.dll restart Apache. View phpinfo.php If you have a memcache module, the installation is successful

2, thinkphp memcache use 1), thinkphp/conf/convention.php Modify cache type

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

Support: file| db| apc| memcache| shmop| sqlite| xcache| apachenote| EACCELERATOR2), thinkphp official download extension thinkphp_extend_3.1.2/extend/driver/cache/cachememcache.class.php saved to: Thinkphp/lib /driver/cache/cachememcache.class.php

3), test:

S (' Test ', ' memcache '); $test = s (' Test '); Echo $test; The

Output memcache indicates that the test was successful.

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