Thinkphpmemcache usage example

Source: Internet
Author: User
Thinkphpmemcache usage example
For usage of memcache in thinkphp, including how to install and run memcache in ThinkPHP, and how to use memcache in thinkphp, refer to the example of using memcache as a cache in thinkphp.

Memcache cache usage in thinkphp

1. download and install memcache1) install memcache in Windows. download memcached.exe to d:/memcached/memcached.exe. run cmd and enter "d:/memcached/memcached.exe-d install. 2) run d:/memcached/memcached.exe-d start to start memcache3), download php_memcache.dll to php installation directory extension directory php \ ext4), and modify php. add extension = php_memcache.dll to ini and restart apache. view phpinfo. if the memcache module exists in php, the installation is successful.

2. use memcache in thinkphp1), ThinkPHP/conf/convention. php modify the cache type

'Data _ CACHE_TYPE '=> 'memcaccache', // DATA cache type,

Supported: File | Db | Apc | Memcache | Shmop | Sqlite | Xcache | Apachenote | Eaccelerator2) and thinkphp official download extensions ThinkPHP_Extend_3.1.2/Extend/Driver/Cache/CacheMemcache. class. save php to: ThinkPHP/Lib/Driver/Cache/CacheMemcache. class. php

3) test:

S ('test', 'memcache'); $ test = S ('test'); echo $ test;

Output memcache, indicating that the test is 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.