How to install Memcached on Ubuntu 16.04

IBM server

Even though Ubuntu is a great desktop operating system, the main users are still server administrators. Next we are going to tell you what to do to have memcached on your server.

Memcached is a program that introduces certain information from the most frequently consulted databases and files into swap or ram memory, in such a way that it speeds up access to these files.

It is a very useful tool that is not normally installed together with PHP and that could be interesting if we have a LAMP or LEMP system. If we want to test such a server or we want to test the performance of this tool, in this post we tell you how to install LAMP o PML  in Ubuntu.

When we have the server installed or we simply have a computer that works as such with the latest LTS version of Ubuntu, we have to open a terminal and write the following:

sudo apt-get update

sudo apt-get install php-memcached memcached

After this it will start the installation of memcached on the server and in our Ubuntu and join as one of the services that are started at the beginning of the system startup. However How do i know if memcached works correctly?

Checking memcached on Ubuntu 16.04

To check the operation of this new tool we will create a file called info.php in the following folder: / Var / www / html. In this file we will introduce the following lines of text:

<? ​phpphpinfo(); ​?>

Once we have saved the text in the document, we go to the web browser and type the following in the navigation bar:

localhost/info.php

After searching for this address, the following will appear in the web browser:

Memcached

If the version of memcached appears as well as the loading time, effectively memcached works correctly, otherwise nothing appears about memcached, we have to go to the list of services and check that not only memcached works but also the rest of the LAMP services.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Pablo Varisco (Bachi) said

    Maybe it was my mistake, but in the info.php file the string should be:

    Only then could I access via Browser and see the file localhost / info.php.

    Good article. Greetings!