Memcached installation (rhel3)

Source: Internet
Author: User

1. Download memcached, libevent, and memcache for PHP
Memcached uses the libevent Library
Memcached official: http://www.danga.com/memcached/
Libevent official version: http://monkey.org/%7Eprovos/libevent/
Memcache PHP module: http://pecl.php.net/package/memcache

2. Extract
Tar-xzvf libevent-1.4.11-stable.tar.gz
Tar-xzvf memcached-1.2.8.tar.gz

 

3. Configure, compile, and install
CD libevent-1.4.11-stable
./Configure -- prefix =/usr
Make
Make install

CD memcached-1.2.8
./Configure -- prefix =/usr
Make
Make install

Note:
If the libevent is not installed in the/usr directory, You need to copy/link the libevent-1.4.11.so.1 (Ln-S) to/usr/lib; otherwise memcached cannot load normally.

 

4. run
/usr/bin/memcached-D-M 128-l 192.168.0.124-P 11211-u nobody
Code :
/usr/bin/memcached-D-M 128-l 192.168.0.124-P 11211-u httpd
parameter explanation:
-D runs memcached in daemon mode.
-D sets the memory size available for memcached, the Unit is M.
-l sets the IP address of the listener. If it is a local machine, this parameter is usually not set.
-P sets the listening port, the default value is 11211. Therefore, you can leave this parameter Unspecified.
-u specifies the user. Root, you need to use this parameter to specify the user.
Of course, there are other parameters that can be used. Man memcached can be seen at a moment.

 

5. Automatic Start

VI/etc/rc. d/rc. Local

Join

Memcached-p 11211-l 192.168.0.124-D-u root-M 128

 

6. Make PHP available to memcached
Tar-xzvf memcache-2.2.5.tgz
CD memcache-2.2.5
/Usr/local/PHP/bin/phpize
./Configure -- enable-memcache -- With-PHP-Config =/usr/local/PHP/bin/PHP-config -- With-zlib-Dir
Make
Make install
Prompt for successful installation: Installing shared extensions:/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20060613/

 

Modify PHP. ini:
Extension_dir = "/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20060613 /"
Extension = memcache. So

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.