Win7 Installing the wamp2.5 version of memcache+memcached

Source: Internet
Author: User
Tags phpinfo

1. Download memcache+memcached

2. run cmd.exe as Administrator and go to the folder where Memcached is located, for example: CD c:\memcached. (If you do not run as an administrator, you will get an error "failed to install service or service already installed")

3. Install memcached:

c:\memcached> memcached.exe-d Install

(after the screen without any hint)

4. Start memcached:

C:\memcached> memcached.exe-d Start

(There is no prompt after the screen, but in Task Manager, check "Show all user Processes", you can see that the Memcached.exe process is running)

By default port 11211, external access needs to open the port, otherwise the connection cannot be successful.

5. Memcached Basic parameter settings:

-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

You need to stop memcached before setting the parameters, and then use the command line settings, such as:c:\memcached> memcached.exe-m 1-d start

6. Stop memcached:

C:\memcached> memcached.exe-d Stop

7. Uninstall memcached:

c:\memcached> memcached.exe-d Uninstall

Related issues:

1. Setting the maximum memory consumption does not seem to work.

-M tells Memcached how much RAM to use for item storage (in megabytes). Note carefully that this isn ' t a global memory limit, so memcached would use a few% more memory than your it to. Set this to safe values. Setting it to less than megabytes does not work properly in 1.4.x and earlier. It'll still use the memory.

Transferred from: http://stackoverflow.com/questions/6112324/memcached-using-more-than-max-memory

Reference: Https://code.google.com/p/memcached/wiki/NewConfiguringServer

2. put a value into the memcache in the same assembly, it can be taken immediately, but not in the other assembly, or Telnet will not get the value.

Possible problems and solutions:

A. Stored values after serialization of different types, you need to update them to the same type, it is recommended to use the same common type, such as String,int, put string can be used to spell an XML string, and then to use when the parsing

B. It is very likely that the memcache pool is full, can be set <socketpool minpoolsize= "" " maxpoolsize=" "" Connectiontimeout= "00:10:00" deadtimeout= "00:02:00"/>


Installing php5.5.12 memcache



Just put Php_memcache.dll in the Php/ext directory.

Then add a piece of content to the php.ini in the PHP directory
Extension=php_memcache.dll

After the addition, restart Apache

Then output phpinfo () on the PHP page;

Check that the memcache is loaded successfully.

If the load is successful, you can do the memcache test on a php page.

<?php//phpinfo (); $memcache = new Memcache; $memcache->connect (' 127.0.0.1 ', 11211) or die (' shit '); $memcache Set (' Key ', ' Hello memcache! '); $out = $memcache->get (' key '); Echo $out;

Successful words will output

Hello memcache!

Win7 Installing the wamp2.5 version of memcache+memcached

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.