Install memcache under Windows

Source: Internet
Author: User

The installation step requires only two steps:

First step: Install the Memcache.exe service.

Step Two: Install the php_memcache.dll extension and let PHP support Memcache.

1. Installing the Memcache.exe Service

Download Memcache.exe can be online Baidu

When you're done downloading, press it into the directory you want to put 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.

(If the system Pthreadgc2.dll is missing when the Memcache.exe-d install command is in the installation process, download the missing file to the system-specified directory

Copy the file directly into the system directory:
1. Windows 95/98/me System, copy Pthreadgc2.dll to C:\Windows\System directory.
2. Windows nt/2000 System, copy Pthreadgc2.dll to C:\WINNT\System32 directory.
3. Windows xp/win7/vista System, copy Pthreadgc2.dll to C:\Windows\System32 directory.
4. If your system is 64-bit, please copy the files to the C:\Windows\SysWOW64 directory.

2. Installing 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

<?php
$mem = new Memcache;
$mem->connect ("localhost", 11211);
$mem->set (' key ', ' I am memcache stored data ', 0,60);
$val = $mem->get (' key ');
Echo $val;

Install memcache under Windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.