Configure memcached and PHP memecache client on Ubuntu (APT-Get Mode)

Source: Internet
Author: User

Memcache is a high-performance distributed memory object cache system. By maintaining a unified and huge hash table in the memory, memcache can be used to store data in various formats, including image, video, file, and database retrieval results.

To develop and use memcache, We must install memcache server and PHP memcache extensions.

1. First install the memcache Server:

$ Sudo apt-Get install memcached

Then you can run the following command to enable memcache:
$ Memcached-l 127.0.0.1-P 11211-D-u nobody-P/var/run/memcached. PID-M 64 m-C 1024-VV

Explain the meanings of several parameters:
-L the IP address of the listener. 127.0.0.1 is the IP address of my local server. If you need multiple servers to read the cached data of this memcached, you must set this IP address.
-P memcached listening TCP port
-D run in daemon mode, SetProgramIn the background
-U memcached running user. I set nobody. By default, memcache is not allowed to log on as a root user.
-P memcached PID file path
-Maximum memory available for M memcached
-C memcached maximum number of connections that can be accepted at the same time
If you want to access memcached through socket, you must remove the-L and-P parameters at startup and add the-S parameter:
-S memcached socket file path

-VV: Display debug information

2. Install the PHP memecache Client
$ Sudo apt-Get install php5-memcache

Restart FastCGI and use phpinfo () to see the memcache extension.

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.