Linux Installation Memcache Extended Support

Source: Internet
Author: User
Tags install php memcached

View related Packages
Yum Search memcached
Installing Memcache
Yum-y Install memcached
Memcache Associated PHP
Yum-y Install Php-pecl-memcache
Verifying the installation Results
Memcached-h
php-m | grep memcache

Add PHP's Memcache extension

    1. Yum Install Php-pecl-memcache
    2. Yum Install Zlib-devel
    3. 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 (normal boot)

Memcached-d-M 10-u root-l 192.168.40.4-p 11211-c 256-p/tmp/memcached.pid (full boot)
Memcached-d-M 1024-u root-p 55001-c 2048 (default boot)

Check if memcached is started
Netstat-an | More
TCP 0 0 192.168.40.4:11211 0.0.0.0:* LIST

Start the memcached Setup boot
Chkconfig memcached on

Start and stop
Service memcached Start | Stop
or/etc/init.d/memcached Start | Stop

Re-start CentOS
Shutdown-r now
Or reboot


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, and here I specify the IP address of the server 192.168.40.4;
-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

memcached Environmental Testing

Run the following PHP file, if you have output this is a memcache test!, it means that the environment to build a successful, start your memcache journey!

<?  $memnew  Memcache; $mem->connect ("192.168.40.4", 11211$mem->set (' key ', ' This is a memcache test! ', 0, 60  $val$mem->get (' key 'echo$val?>

This article turns from http://www.linuxidc.com/linux/2011-09/43033.htm!

Linux Installation Memcache Extended Support

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.