Memcache installation under Windows
Over time, most of the documents that are now available online to install Memcache under Windows are obsolete. Xuefeng Here is a brief introduction to the current version of the installation and configuration method.
Memcached in its official website is constantly updated, unfortunately only the source code, no Windows compiled version.
http://memcached.org/
Find the latest Windows compiled version of the current
http://code.jellycan.com/memcached/
Find Win32 Binary:memcached-1.2.6-win32-bin.zip Direct download. (Of course, here is also introduced in Windows under the specific method of compiling, interested can try it yourself.) There is no difference between the installation and other versions:
Unzip to a directory, such as C:\memcached,
In the command line state, enter: C:\memcached\memcached.exe-d install. Now that memcached is installed as a Windows service, you can start the Memcached service with memcached.exe-d start, or you can start it in Windows services.
Configure PHP
PHP's official website also does not provide the Windows version of the memcached extension, fortunately there are
Http://downloads.php.net/pierre/
Search Memcache will find the following files on this page
Php_memcache-2.2.6-5.3-nts-vc9-x86.zip (2010-10-03 13:46-0700)
MD5 (php_memcache-2.2.6-5.3-nts-vc9-x86.zip) = DE463EA7271C357F2E317128A5370BFB
Php_memcache-2.2.6-5.3-vc9-x86.zip (2010-10-03 13:45-0700)
MD5 (php_memcache-2.2.6-5.3-vc9-x86.zip) = 2021ceb248dabae438796c9ccfa1c2e3
According to your own PHP environment to choose the appropriate version, please check the PHP information returned by Phpinfo (), find the PHP Extension Build, my value here is "API20090626,TS,VC9", I choose php_memcache-2.2.6-5 .3-vc9-x86.zip.
After downloading the decompression, put in the PHP extension directory, such as I here is the PHP installation directory of the Ext folder, and then add a php.ini in the
Extension=php_memcache.dll
Restart the HTTP service, such as Apache, and then come back to see Phpinfo () More than a memcache section, indicating that the extension has been installed successfully. If it is wrong to restart the HTTP service times, it is usually the version of the PHP extension that is not correct, swap the other version and try again.
Finally, the sample code in the PHP manual test, the function is normal installation is complete.
Memcache installation and configuration under Windows
1.
Many phper do not know how to build memcache under Windows Development Debugging environment, recently, individuals are also studying memcache, recording their own installation of the process.
In fact, I began to study memcache did not know incredibly still have memcached for Win32 this bird thing, harm I cnetos under the 1 days to fix, today suddenly found under Windows Memcache to develop debugging completely no problem, So write a memcache document to share with everyone.
Memcache installation under Windows:
1. Download Memcache's Windows stable version and unzip it under a disk, for example, in c:\memcached
2. Enter the ' c:\memcached\memcached.exe-d install ' installation in the terminal (also known as the cmd Command interface)
3. Re-enter: ' c:\memcached\memcached.exe-d start ' starts. Note: memcached will start automatically every time a service is turned on for Windows. This way the server side is already installed.
4. Download Php_memcache.dll, please find the corresponding PHP version of the file yourself
5. Add a line of ' Extension=php_memcache.dll ' to C:\winnt\php.ini
6. Restart Apache, then check the phpinfo, if there is memcache, then the installation is successful!
Basic Settings for memcached:
-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
Memcache Environmental Testing:
Run the following PHP file, if there is output this is a test!, it indicates that the environment was built successfully. Begin to appreciate the charm of memcache!
< PHP
$mem = new Memcache;
$mem->connect ("127.0.0.1″, 11211);
$mem->set (' key ', ' This is a test! ', 0, 60);
$val = $mem->get (' key ');
Echo $val;
?>
2.
Windows mencached double Open
Submitted by eglic on, April, 7:35 PM
It takes two memcached to develop and debug a project from a Linux-based company to a Windows platform
This is the script under Linux.
#For session
/usr/local/bin/memcached-l 127.0.0.1-p 11212-m 128-c 256-d
/usr/local/bin/memcached-l 127.0.0.1-p 11211-m 512-c 256-d
Win32 version of the memcached is the system services, to double-open the need to install two services
The method of changing the file name is useless, have to change the registration form violently, the steps are as follows
1. Run C:\Memcached\Memcached.exe-d install in cmd
2. Open Registry Editor and navigate to hkey_local_machine\system\currentcontrolset\services\memcached Server
Change the directory name (memcached Server) to "memcached Session Service".
The value of the key DisplayName is also changed to "Memcached Session Service".
The value of the key ImagePath is changed to "C:\memcached\memcached.exe"-p 11211-m 8-d Runservice
3. Restart your computer
4. Run C:\Memcached\Memcached.exe-d install again in cmd
5. Open Registry Editor and navigate to hkey_local_machine\system\currentcontrolset\services\memcached Server again
Change the directory name (memcached Server) to "memcached Data Service".
The value of the key DisplayName is also changed to "Memcached Data Service".
The value of the key ImagePath is changed to "C:\memcached\memcached.exe"-p 11212-m 64-d Runservice
6, in the management tools and services, press F5 Refresh, you should be able to see two memcached beginning of the service, start it.
7, if the 6th step is not done, restart, fix the work
Windows under Memcache installation uses