Recently to play memcache, so need to build a Windows 64-bit under the development of Memcache debugging environment, record their own installation of the process, found more simple than the build Linux.
Here's the process of installing memcache with Windows 7 64Bit
1, install PHP, MySQL and Apache, this environment I do not need to do more introduction, a key environment has a lot, almost no impact on memcache. (My own debugging environment is Phpstudy)
2, download installs the memcache, I download here is the 64-bit version.
Download Address: http://www.php.net/softs/205839.html
A) Download the extract and put it in the hard disk directory, such as: D:\memcached.
b) then enter CMD into the command line in the run and enter into the directory where the Memcached.exe is located, for example: D:\memcached
c) Then in the Memcache directory, enter memcached.exe–d install, add Memcached.exe as Service
d) Enter memcached.exe-d start and run the memcached program.
C:\USERS\TEST>D:D:\>CD d:\memcached:\memcache>memcached.exe-d installd:\memcache>memcached.exe-d Start
memcahed Basic setup parameters:
-P Listening Port (default is 11211)-L connection IP address, default is native-D start memcached service-D Restart Restart memcached service-D stop|shutdown Close running memcached service-D Install memcached Service-D Uninstall uninstall memcached service-U Run as identity (only valid when running as root)-m maximum memory usage, in MB. The default 64mb-m memory is exhausted when the error is returned, instead of deleting the item-C maximum number of simultaneous connections, the default is the 1024-F block size growth factor, default is 1.25-n minimum allocation space, key+value+flags default is 48-h display Help
Note: After the experiment using the command to modify the port is invalid, the corresponding solution is to modify the registry to achieve this modification port and configuration purposes.
The values I have modified are as follows: (Maximum memory size 1024M, max connections: 2048,ip address: 127.0.0.1, port default is 11211, effective requires restart Memcached.exe service)
Enter the registry to locate Hkey_local_machine\system\currentcontrolset\services\memcached Server, where there is a ImagePath entry with a value of "d:\memcached\ Memcached.exe "-D runservice, appended with-L 127.0.0.1-M 1024-c 2048 The last ImagePath item value should look like this: D:\memcached\memcached.exe"-D runse Rvice-l 127.0.0.1-m 1024-c 2048
Use Telnet to test the memcache:
Telnet 127.0.0.1 11211 (Note: You need to use the IP and port settings here)
Input stats
3, modify php.ini extension support memcached.
Download Php_memcache.dll, please find the corresponding PHP version of the file yourself. I use the phpstudy of a key environment to bring the Memcached.dll file.
Just modify the extension, plus Extension=php_memcache.dll
4, restart Apache, and then check the phpinfo, if there is memcache, then the installation is successful
5. Simple Test memcache operation
< $memcache = new Memcache; $memcache->connect ("127.0.0.1", 11211); echo "Server's version:". $memcache->getversion (). "
\ n "; $memcache->set (' key ', ' This is a test! ', 0, $); $val = $memcache->get (' key '); Echo $val;? >
Appears after running:
Server ' s version:1.4.2
This is a test!