Install and configure memcached.exe in windows/linux/PHP _ PHP Tutorial

Source: Internet
Author: User
Install and configure memcached.exe in windowslinuxphp. This document introduces how to install and configure memcached.exe in Windows Firewall PHP and memcached configuration in liunx. you can configure it in either method or method based on your system. In windows + php, the document introduces the installation and configuration of memcached.exe in windows Firewall php and the memcached configuration in liunx. you can configure it in either method or method two based on your system.

Install and configure memcached.exe in windows#php

1. Windows version: http://code.jellycan.com/memcached/

Decompress the compressed file to c:/memcached/

2. enter "c:/memcached/memcached.exe-d install" in CMD to install the tool.

3. enter "c:/memcached/memcached.exe-d start" to start. NOTE: In the future, memcached will be used as a windows service and will be automatically started every time it is started. In this way, the server has been installed.

4. if-m is specified, it indicates the number after the cache size is-m. The unit is M. for example:

C:/memcached/memcached.exe-l 127.0.0.1-m 32-d start

Configure memcached memory usage as follows:

After the above installation steps are followed, after you use memcached-m 200 to adjust the maximum memory usage, you will find that it does not work. it is always the default 64 MB of memory. I searched for it online, the reason is that no information is written in the registry. you can modify the information in this way.

1. memcached-d shutdown first shut down the memcached service.

2. go to the registry and find the HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/memcached Server. there is an ImagePath item in it. The value is "c:/memcached/memcached.exe"-d runservice, add-l 127.0.0.1-m 3000-c 2048 to the end.

3. memcached-d start starts the memcached service, so that the maximum memory size of memcached is changed to 3000 MB.

If the download is a binary version, you can directly run it. you can add parameters to set it.

Common settings:

-P Listening port
-L The IP address to connect to. the default value is local.
-D start: start the memcached service.
-D restart: restart the memcached service.
-D stop | shutdown the running memcached service
-D install the memcached service
-D uninstall memcached service
-U To (Only valid when running as root)
-M Maximum memory usage, in MB. The default value is 64 MB.
-An error is returned when M memory is used up, instead of deleting items.
-C Maximum number of simultaneous connections. the default value is 1024.
-F Block size growth factor. the default value is 1.25.
-N Minimum allocation space. the default value of key + value + flags is 48.
-H Show Help

Install and configure memcached.exe in linux+php

Homepage
Http://www.danga.com/memcached

:
Http://danga.com/memcached/download.bml

Download Files
Memcached-1.2.6.tar.gz
Tar zxvf memcached-1.2.6.tar.gz
../Configure -- prefix =/usr/local/memcached-1.2.6
Make
Make install

Note:

Memcache requires this package libevent, or an error will be reported during installation:

Checking for libevent directory... configure: error: libevent is required. You can get it from http://www.monkey.org /~ Provos/libevent/

If it's already installed, specify its path using -- with-libevent =/dir/

Download the libevent-1.4.9-stable.tar.gz file.

Tar zxvf libevent-1.4.9-stable.tar.gz

../Configure -- prefix =/usr/local/libevent-1.4.9-stable.tar.gz
Make
Make install

Because I have not installed memcache in usr, the following error occurs when I start memcache:

[Root @ localhost bin] #./memcached-d-m 10-p 11211-u root-l 0.0.0.0
./Memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

Check the installation status of libevent:

Ls-al/usr/lib | grep libevent
Copy/link the libevent-1.4.so.2 to/usr/lib, otherwise memcached cannot be loaded normally.

Cp libevent-1.4.so.2/usr/lib/

Article Source: http://www.diybl.com/course/6_system/linux/linuxjq/20071010/77432.html


Start the service after installation.
Cd/usr/local/memcached-1.2.6/bin
./Memcached-d-m 50-p 11211-u root-l 0.0.0.0
Parameter description
-M: specifies the MB of cache space used;
-P: specifies the port to be listened on;
-U specifies the user to run

Memcached configuration. you can use either method 1 or method 2 to configure it based on your system. Windows + php...

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.