The memcache sonsists of 2 parts: the server MemCached and the client MemCache.
- MemCached is the cache server, the same as Mysqld (mysql server), which save and feed cache to clients.
- MemCache is a client. With php, we need to install it as a mod, just the same as pdo_mysql (php_pdo_mysql.dll on windows).
- Download memcached from http://code.jellycan.com/memcached/ (get the win32 binary version). Here we suppose you extract the memcached in d:\memcached\.
- If you are on Sindows Vista/7, rightclick on memcached.exe and select Properties; click on the Compatibility tab. At the bottom you’ll see Privilege Level, check “Run this program as an administrator”.
- Open the command line by Win + R (or Start -> All Programs -> Accessories -> Command Prompt), and then run:
d:\memcached\memcached.exe -d installto install the service.
- Still in the command line, run
d:\memcached\memcached.exe -d start, or
net start "memcached Server"to start the service.
- Check whether the service is running. Open Windows Task Manager, go to Services tab, you should find status of “memcached server” is “Running”.
Install MemCache php module
- Download memcache. Win 32 bit version: http://downloads.php.net/pierre/ and 64 bit version: http://www.anindya.com/php-5-3-3-x64-64-bit-for-windows/ (choose Memcache 2.2.6 VC9 x64 Thread Safe).
- Extract memcache to you WAMP php ext folder, for example: D:\wamp\bin\php\php5.3.4\ext.
- Edit your php.ini file by adding:
- Restart apache server.
php_info();and you will find a module “memcache”.
- To change MemCached memory size (default is 64mb), go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached Server in your registry, find the ImagePath entry and change it to:
“C:\memcached\memcached.exe” -d runservice -m 512
- More details see: