First, download and install Memcached server-side software
1. Download memcached software
32-bit: memcached-win32-1.4.4-14.zip (direct download), Memcached-win32-1.4.4-14.zip download page: http://blog.couchbase.com/ Memcached-144-windows-32-bit-binary-now-available
64-bit: memcached-win64-1.4.4-14.zip (direct download), Memcached-win64-1.4.4-14.zip download page: http://blog.couchbase.com/ Memcached-windows-64-bit-pre-release-available
I'm using a wamp,64 computer. Download the memcached server-side software compression Pack.
Unzip the package to the specified directory, I chose D:\memcached
2, installation memcached
Run Cmd.exe as Administrator and go to the folder where Memcached is located. and install memcached.
No prompts after installation.
3. Start memcached Service
Continue to execute the memcached command on Cmd.exe:
memcached.exe-d start
Then go to the task Manager process to see if the Memcached service has started.
4. memcached Basic Parameter setting
-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
-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
5. Stop and unload commands for memcached
1 d:\memcached> memcached.exe-D stop2 d:\memcached> memcached.exe-d Uninstall
Second,PHP installation memcache extension
1. Download Memcache.dll extension
: Http://pecl.php.net/package/memcache/3.0.8/windows
Download considerations: Select the version that matches your environment and the thread-safe version.
My local use of the wamp2.5 PHP version is 5.5 Windows 64-bit and is 5.5 Thread Safe (TS) x64
2, after the download is complete, decompression compression Baouru.
Copy the Php_memcache.dll extension file into the PHP extension directory, for example (D:\wamp\bin\php\php5.5.12\ext)
3. Modify the php.ini file
Open php php.ini file (my address is: D:\wamp\bin\apache\apache2.4.9\bin\php.ini)
Add a line of code:
Extension=php_memcache.dll
Note: You must have a new line, preceded by a semicolon. The semicolon represents the comment point and cannot be used.
Then after saving, reboot the server (Apache or Nginx or IIS) and I'll just restart Wamp.
Browser input: Http://localhost/?phpinfo=1 can see that the memcache extension is already loaded.
Third,PHP program test memcache function Local availability
Create a new PHP file test.php
<?php$memcache = new Memcache; $memcache->connect (' 127.0.0.1 ', 11211) or die (' shit '); $memcache->set (' key ', ' Hello memcache! '); $out = $memcache->get (' key '); Echo $out;
The file is then accessed through a browser, and the normal results can be seen in the input:
Hello memcache!
Finished.
PHP memcache extension Installation for Windows