CentOS system to install php-memcached module tutorial for PHP

Source: Internet
Author: User
Tags install php memcached php memcached centos

Install method One, use wget to install directly

System: CentOS 5.5
Required Packages: libmemcached-1.0.15.tar.gz
Memcached-2.1.0.tgz
1. Pre-Installation Preparation

The code is as follows Copy Code

wget https://launchpad.net/libmemcached/1.0/1.0.15/+download/libmemcached-1.0.15.tar.gz
wget http://pecl.php.net/get/memcached-2.1.0.tgz

2. Install libmemcached

The code is as follows Copy Code

Tar zxf libmemcached-1.0.15.tar.gz && CD libmemcached-1.0.15
./configure--prefix=/usr/local/libmemcached--with-memcached
Make && make install

3. Install php-memcached

The code is as follows Copy Code

Tar zxf memcached-2.1.0.tgz && CD memcached-2.1.0
/usr/local/php/bin/phpize
./configure--enable-memcached--with-php-config=/usr/local/php/bin/php-config--with-libmemcacheddir=/usr/local/ Libmemcached
Make && make install
Vi/etc/php.d/memcached.ini
extension= "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/memcached.so"

4. Verify

The code is as follows Copy Code

Php-m|grep memcached
Memcached

Finally reboot Apache.

Method two, using Yum install installation

I. Installation of libevent development kits

The code is as follows Copy Code

Yum Install Libevent-devel

Second, install memcached

We get memcached installation package memcached-1.4.15.tar.gz from http://memcached.org/.

1. Configuration (Specify installation directory via parameter prefix)

The code is as follows Copy Code
./configure--prefix=/usr/local/memcached--ENABLE-SASL

2. Compiling and installing

The code is as follows Copy Code

Make
Make install

Iii. installation of libmemcached

Download the installation package libmemcached-1.0.15.tar.gz from the http://libmemcached.org/.

Configuration, compilation, and installation (–with-memcached specifies memcached execution program)

The code is as follows Copy Code

./configure--with-memcached=/usr/local/memcached/bin/memcached
Make
Make install


Iv. Installing PHP memcached Extensions

The code is as follows Copy Code
/usr/local/php/bin/pecl Install memcached

Add

Start

The code is as follows Copy Code

memcached-d-u root-m 64-c 1024

The

-d option is to start a daemon
--The amount of memory that is allocated to memcache by the MB
-u run memcache user
-L Listener Server IP address
-p set memcache listening port. Preferably more than 1024 of the port
-C Maximum number of concurrent connections, the default is 1024, according to your server load to set
-p settings save memcache pid file

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.