Memcached is a high-performance database system that can help supercharge your application. It's very fast as it does not write to the disk, but instead to system memory.
In this guide, I will explain how to install Memcached on an Ubuntu 14.04 server. This guide covers installing the PHP Memcached plugin too.
Step 1: Verifying prerequisites
There is some required software you need in order to be able to use Memcache:
If you do not have these installed yet, install them with
apt-get install mysql-server php5-mysql php5
Step 2: Installing Memcache
Once you have MySQL and PHP installed, it's time to install Memcache. You can install Memcached by using
apt-get install memcached
After installing Memcache, you will need to install its PHP extension. This allows for communication between PHP and Memcache:
apt-get install php5-memcached
You may receive the following error:
E: Unable to locate package php5-memcached
If so, update your
apt-get repository list:
After that's finished, try again.
Step 3: Editing configuration
The configuration file is located at:
Open this file with your favorite text editor should you want to change the port Memcached runs on, the maximum memory, or the number of simultaneous connections.
- -p: port
- -m: memory
- -c: maximum allowed simultaneous connections
Once you have changed these settings, restart the
service memcached restart
Congratulations! Memcached is installed on your Ubuntu 14.04 server. You can now configure your applications so that they will use the Memcached database.
Link - 淘实惠-使用采购网站
This article was created by DieDie
This work is licensed under a Creative Commons Attribution 4.0 International License.
This article source How To Install Memcached on Ubuntu 14.04
Last Modified Apr 16, 2019 at 12:56 am