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