Add Memcache extension support to PHP in Linux

Source: Internet
Author: User
Download and install Memcached server yuminstalllibevent-develwgethttp: memcached.googlecode.comfilesmemcached-1.4.5.tar.gztar-zxvfmemcached-1.4.5.tar.gz. configure -- prefixusrlocalmemcached -- buildi686-pc-linux-gnu this step will see a lack of GCC download and install Me McAch EdServer
  1. Yum install libevent-devel
  2. Wget http://memcached.googlecode.com/FileS/memcached-1.4.5.tar.gz
  3. Tar-zxvf memcached-1.4.5.tar.gz 
  1. ./Configure -- prefix =/usr/local/memcached -- build = i686-pc-linux-gnu

GCC is missing in this step.

  1. Yum install gcc
  2. ./Configure -- prefix =/usr/local/memcached
  3. Make
  4. Make install

AddPHPMemcache Extension

  1. Yum installPhp-Pecl-memcache
  2. Yum install zlib-devel
  3. Pecl install memcache

Add"ExTension = memcache. so"

Start Memcached Service

  1. Memcached-d-m 512-l 127.0.0.1-p 11211-u root

Appendix:

Memcached-d-m 10-u root-l 192.168.40.4-p 12000-c 256-P/tmp/memcached. pId(Complete startup)
Memcached-d-m 1024-u root-p 55001-c 2048 (started by default)

 
Parameter description:
-D option is to start a daemon
-M indicates the amount of memory allocated to Memcache. The unit is MB. Here is 10 MB.
-U is the user who runs Memcache. Here I am the root user.
-L is the IP address of the listener server.
-P is the port used to set Memcache listening, preferably over 1024.
-The c option is the maximum number of concurrent connections running. The default value is 1024, Which is set based on the load of your server.
-P is the pid file for saving Memcache.
-Vv debugging mode

Related Article

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.