Build PHP + Memcached under RHEL5.4 (Tikanga)

Source: Internet
Author: User
The premise for setting up PHP + Memcached based on this article is that PHP5.3.4 and Apache2.2.3 have been installed. Next, install Memcached (server) and PHP extension memcache or memcached (in actual use, you can select one of them .) 1) install Memcached (server) read: Configure Apache + FastCGI (mod_fcgid) + PH on RHEL5.3 (Tikanga)

The premise for setting up PHP + Memcached based on this article is that PHP 5.3.4 and Apache 2.2.3 have been installed. Next, install Memcached (server) and memcache or memcached (in actual use, you can select one of them .)

1) install Memcached (server)

Related reading:

Configure Apache + FastCGI (mod_fcgid) + PHP http://www.linuxidc.com/Linux/2012-02/53418.htm on RHEL 5.3 (Tikanga)

Build Git http://www.linuxidc.com/Linux/2012-02/53420.htm at RHEL 5.3 (Tikanga)

Configure Apache + FastCGI (mod_fastcgi) + PHP http://www.linuxidc.com/Linux/2012-02/53419.htm on RHEL 5.3 (Tikanga)

A. Download and compile and install libevent.

[Plain]
  1. Wget http://www.monkey.org /~ Provos/libevent-2.0.7-rc.tar.gz
  2. Tar-xzvf libevent-2.0.7-rc.tar.gz
  3. Cd libevent-2.0.7
  4. ./Configure & make
  5. Make install

B. Download and compile and install Memcached (server)

[Plain]
  1. Wget http://memcached.googlecode.com/files/memcached-1.4.9.tar.gz
  2. Tar-xzvf memcached-1.4.9.tar.gz
  3. Cd memcached-1.4.9
  4. ./Configure-prefix =/usr/local
  5. Make
  6. Make test
  7. Make install
C. Run the following command to start Memcached in daemon mode:

[Plain]
  1. Memcached-d-u root

2) install memcache
A. Download and compile and install memcache

(Find the latest version: http://pecl.php.net/package/memcache here)

[Plain]
  1. Wget http://pecl.php.net/get/memcache-3.0.5.tgz
  2. Tar-xzvf memcache-3.0.5.tgz
  3. Cd memcache-3.0.5
  4. Phpize
  5. ./Configure -- enable-memcache -- with-php-config =/usr/bin/php-config
  6. Make & make test
  7. Make install

B. Enable PHP to load this module.

[Plain]
  1. Cd/etc/php. d
  2. Vim memcache. ini
  3. ; Enable memcache extension module
  4. Extension = memcache. so

C. Check whether the module is successfully loaded.

[Plain]
  1. Php-m | grep memcache

D. Access the memcache management interface.

[Plain]
  1. Cp ~ /Memcache-3.0.5/memcache. php/var/www/memcache. php
  2. Vim/var/www/memcache. php
  3. $ MEMCACHE_SERVERS [] = '192. 0.0.1: 100 ';
  4. Access following URL:
  5. Http://x.x.com/memcache.php

3) Use PECL (The PHP Extension Community Library) to install memcached

A. Download and compile and install libmemcached.

[Plain]
  1. Wget http://launchpad.net/libmemcached/1.0/1.0.2/+download/libmemcached-1.0.2.tar.gz
  2. Tar-xzvf libmemcached-1.0.2.tar.gz
  3. Cd libmemcached-1.0.2
  4. ./Configure
  5. Make
  6. Make install

B. Use PECL to install memcached.

[Plain]
  1. Pecl install memcached

C. Enable php to load this module

[Plain]

  1. Cd/etc/php. d
  2. Vim memcached. ini
  3. ; Enable memcached extension module
  4. Extension = memcached. so

D. Check whether the module is successfully loaded.

[Plain]
  1. Php-m | grep memcached

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.