How to install memcached on Ubuntu

This guide will help you install memcached onyour Ubuntu system. Memcache is a PECL Extension which works with your PHP and improves caching so that your web page loads faster.

 

To install memcache in Ubuntu open terminal window and follow these steps in it,

I am assuming that you have PHP and MySQL up and running perfectly if not follow these steps first and then come back.

 

 

To install memcache in Ubuntu open terminal window and follow these steps in it,

I am assuming that you have PHP and MySQL up and running perfectly if not follow these steps first and then come back

 

First copy this command

 sudo apt-get install memcached

This will install memcached onto your server

 

To use memcache you must install pear repository  which will store memcache

sudo apt-get install php-pear

 

If you do not have a compiler on your server, you can download build-essential in order to install memcache

sudo apt-get install build-essential

 

now install

apt-get install php5-dev

 

and install PECL library

sudo pecl install memcache

 

Now write memcached extension in your memcache.ini file

sudo echo "extension=memcache.so" > sudo /etc/php5/conf.d/memcache.ini

Here you are done installing memcache, if you want to check whether it is instlled or not type below command

echo "stats settings" | nc localhost 11211

 

Author: 
Source: 
https://www.digitalocean.com/community/articles/how-to-install-and-use-memcache-on-ubuntu-12-04

Add new comment