1. download and install memcache(1)windowinstall memcache.download memcached.exe to d:/memcached/memcached.exe. run cmd and enter d:/m...
1. download and install memcache
(1) 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 memcache.
(3) download php_memcache.dll to the php installation directory extension directory php \ ext
(4) modify php. ini and add extension = php_memcache.dll to restart apache. check phpinfo. php. if the memcache module exists, the installation is successful.
2. use memcache in thinkphp
(1) ThinkPHP/conf/convention. php modify the cache type
'Data _ CACHE_TYPE '=> 'memcaccache', // DATA cache type,
Supported: File | Db | Apc | Memcache | Shmop | Sqlite | Xcache | Apachenote | Eaccelerator
(2) thinkphp official download extensions ThinkPHP_Extend_3.1.2/Extend/Driver/Cache/CacheMemcache. class. php save to ThinkPHP/Lib/Driver/Cache/CacheMemcache. class. php
(3) test: S ('test', 'memcache'); $ test = S ('test'); echo $ test;
The memcache output is tested successfully.