Ubuntu Linux 12.04/14.04 LTS Install Memcached Server For Python and PHP Apps

I’m a new Ubuntu 12.04/14.04 server user. How do I install and use memcached on an Ubuntu Linux 14.04 LTS server? How can I my apps written in PHP or Python can use memcached on an Ubuntu LTS server?

Memcached is a general-purpose distributed memory caching system. It is usually used to speed up dynamic database-driven webapps or websites by caching objects in RAM. It is often result into reducing database load.