Home > Article > Backend Development > Usage examples of memcache in thinkphp, thinkphpmemcache_PHP tutorial
The example in this article describes the usage of memcache in thinkphp. Share it with 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 cmd and enter .
② Run d:/memcached/memcached.exe -d start to start memcache
③ Download php_memcache.dll to the php installation directory extension directory phpext
④ Modify php.ini and add extension=php_memcache.dll. Restart apache. Check phpinfo.php. If there is memcache module, it means the installation is successful
2. Use of memcache in thinkphp
① ThinkPHP/conf/convention.php Modify cache type
Supports: 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:
Output memcache test successful.
I hope this article will be helpful to everyone’s ThinkPHP framework programming.