In fact, it takes only two steps to install it:
First step: Install the Memcached.exe service.
Step Two: Install the php_memcache.dll extension and let PHP support Memcache.
1: Install the Memcached.exe service
Download Memcached.exe
: Http://www.hlmblog.com/dload/memcached-1.2.6-win32-bin.zip
After extracting it, put it in the directory you want to put it in.
Run:
Related parameters of memcache operation
-P Listening Port
-L connected IP address, default is native
-D Start memcached service
-D Restart Restart memcached service
-D Stop|shutdown Close the running memcached service
-D Install memcached service
-d Uninstall Uninstall memcached service
-U Run as (only valid when running as root)
-m maximum memory usage, in megabytes. Default 64MB (set Memcache size)
-M running out of memory and returning an error instead of deleting an item
-c Maximum number of simultaneous connections, default is 1024
-F Block size growth factor, default is 1.25
-N Minimum allocated space, key+value+flags default is 48
-H Display Help
If there are no errors as shown in the figure above, it is the Memcache.exe service installation OK.
2: Install the Php_memcache.dll extension
Download Php_memcache.dll, download the version must be suitable for your own PHP version,:
Http://www.hlmblog.com/dload/php_memcache.dll_.rar
There is a php_memcache.dll file for php5.2*,php5.3*,php5.4*, put Php_memcache.dll in the Ext folder of PHP, Open php.ini, find the keyword extension, you can see a lot of PHP extension, and then add Extension=php_memcache.dll this line of code, restart Wamp server, extension installation is complete.
3: Testing and validation
1 2 3 4 5 6 |
$mem=NewMemcache; $mem-Connect("LocalHost",11211)   $mem -> set ( ' key ' , ' I am memcache stored data ' ,0,60 ; $val = $mem -> get ( ' key ' ) ;   echo $val //output as "I am memcache stored data", indicating that Windows local Memcache has been successfully installed!! |
Install memcache-related configuration under Window