First of all, many caching services are used during PHP development to improve access quality or temporarily store some data.
The advantages are simple structure, fast reading speed and easy maintenance. There are some features memcache Redis MongoDB can be used as a cache, but they each have their own advantages and characteristics. Today, we introduce the installation and application examples of Mamcache:
Memcache's Windows Chapter:
: Link: Http://pan.baidu.com/s/1o84cM6I Password: ycyi
Unzip into the D disk under the Mamcache directory there is a Memcache.exe file, double-click on the installation can be. Or run DOS execution as an administrator
c:\users\lr>d:\memcached\memcached.exe-d Install
After the installation is complete on my Computer-right-click Properties-Management-Services-Find Mamcache Server Select Start and set to automatically enable boot;
Inside the DOS link Mamcache can be used with telnet command:
127.0. 0.1 11211
Of course win7 above the system does not turn on the Telnet command to open the settings: Control Panel-Programs and apps-start or close the Windows feature found Telnet client check the confirmation wait for the installation to complete;
To this Windows installation has completed later unified say Memcache action command
Below is the Linux installation memcache:
can go to the official website download of course also can use My network disk: Link: http://pan.baidu.com/s/1dFeCHv7 Password: Q8VK
Main TWO packages: memcached-1.4.28.tar.gz main package and libevent-1.4.14b-stable.tar.gz extension Lib package dependent
[email protected]Ten--195 memcached]#tar zxvf *.tar.gz
[Email protected] libevent-1.414b-stable]#./configure--prefix=/usr/local/libevent-1.4.14b- Stable[[email protected] libevent-1.4. 14b-stable]# make && make install
[Email protected] memcache]# tar zxvf memcached-1.4. tar.gz | Tar zxvf libevent-1.4. 14b-stable.tar.gz
Install Mamcache:
[Email protected] libevent-1.4. 14b-stable]# CD. /memcached-1.4. [[email protected] memcached-1.4. ]#./configure--prefix=/usr/local/memcache-1.4. 5 --with-libevent=/usr/local/libevent-1.414b-stable[[email protected] memcached- 1.4. [] # Make && make install
Create a user to start Memcache:
[Email protected] memcached-1.4. [] # useradd-r memcached-s/sbin/nologin[[email protected] memcached-1.4. ]# cat/etc/passwd | grep memcachedmemcached:x: 993:991::/home/memcached:/sbin/nologin
Start:
The relevant explanations are as follows:-the D option is to start a daemon,-m is the amount of memory allocated to Memcache, in megabytes, 200MB-You are the user running memcache, and if you are currently root, you need to specify the user with this parameter. -L is the server IP address of the listener, if there are multiple addresses, I specify the IP address of the server 192.168.1. the-p is set memcache listening port, I set 12301 here, preferably more than 1024 ports-The c option is the maximum number of concurrent connections to run, the default is 1024, where the-P is set to save memcache PID file, I am here to save in/tmp/memcached.pid Stop memcache process: # kill ' Cat/tmp/Memcached.pid ' can also start multiple daemons, but the ports cannot be duplicated-d Install installation memcached-d Uninstall unloading memcached-d start memcached service-d Restart Restart memcached service-d stop Stop memcached service-D Shutdown Stop memcached service
More parameters can be: [[email protected] memcached-1.4.28]#/usr/local/memcache-1.4.5/bin/memcached-h
To query: The following is my startup command very simple:
[Email protected] memcached-1.4. -]#/usr/local/memcache-1.4.5/bin/memcached-u memcached-p11211-M --C1024x768&[1]52262[email protected] memcached-1.4. -]# Ps-ef |grep Memcachememcach+52262 10803 0 -: *pts/1 xx:xx:xx/usr/local/memcache-1.4.5/bin/memcached-u memcached-p11211-M --C1024x768Root52270 10803 0 -: *pts/1 xx:xx:xxgrep--color=auto Memcache
Of course, you can also use:
[Email protected] memcached-1.4. -]# Netstat-lp |grep memcachedtcp0 0 0.0.0.0: Memcache0.0.0.0:* LISTEN52262/memcached TCP60 0[::]:memcache [::]:* LISTEN52262/memcached UDP0 0 0.0.0.0: Memcache0.0.0.0:*52262/memcached UDP60 0[::]:memcache [::]:*52262/memcached
OK to compile and install under Linux:
Of course there is a way to install yum-y installed libevent memcache under Linux
You can install it. The way is simple with path can be any path under memcached to start or modify the view Help and so on. The same.
Access under Linux can also be accessed via Telnet 127.0.0.1 11211:
After entering: Refer to the Jump path: The article is too long
[NoSQL cache memcache] install Linux for Windows