Download Install memcached server
- Yum Install Libevent-devel
- wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
- TAR-ZXVF memcached-1.4.5.tar.gz
- ./configure--prefix=/usr/local/memcached--build=i686-pc-linux-gnu
This step will see a lack of GCC
- Yum Install GCC
- ./configure--prefix=/usr/local/memcached
- Make
- Make install
Add PHP's Memcache extension
- Yum Install Php-pecl-memcache
- Yum Install Zlib-devel
- PECL Install Memcache
Add "extension=memcache.so" to the PHP configuration file
Start the memcached service
- Memcached-d-M 512-l 127.0.0.1-p 11211-u Root
Report:
Memcached-d-M 10-u root-l 192.168.40.4-p 12000-c 256-p/tmp/memcached.pid (full boot)
Memcached-d-M 1024-u root-p 55001-c 2048 (default boot)
Parameter description:
The-D option is to start a daemon
-M is the amount of memory allocated to Memcache, in megabytes, I'm 10MB.
-U is the user running memcache, I am root here
-L is the server IP address of the listener
-P is the port that sets Memcache listening, preferably a port above 1024
The-c option is the maximum number of concurrent connections to run, which is 1024 by default and is set according to the load on your server
-P is a PID file that is set to save Memcache
-VV Debug Mode
RELATED Links: http://blog.csdn.net/php_boy/article/details/6880488
http://koda.iteye.com/blog/665761
Http://www.linuxidc.com/Linux/2011-09/43033.htm
http://my.oschina.net/ruiorz/blog/280165
Linux memcache extension method for installing PHP