Here are 2 steps for you know How to use Memcache in Magento 2 in Ubuntu:

  • Step 1 :To install and configure memcached on Ubuntu
  • Step 2 : To configure Magento to use memcache

Step 1 :To install and configure memcached on Ubuntu

1.As a user with root privileges, enter the following command:

apt-get -y update
apt-get -y install php5-memcache memcached

2.Change the memcached configuration setting for CACHESIZE and -l:

    1. Open /etc/memcached.conf in a text editor.
    2. Locate the -m parameter and change its value to at least 1GB
    3. Locate the -l parameter and change its value to 127.0.0.1 or localhost
    4. Save your changes to memcached.conf and exit the text editor.
    5. Restart memcached.
    6. service memcached restart

3.Restart your web server: service apache2 restart

Step 2 : To configure Magento to use memcache

1.Open <your Magento install dir>/app/etc/env.php

2.Locate the following:

To verify memcached works with Magento:

  1. Delete the contents of the following directories under your Magento installation directory:
  2. rm -rf var/cache/* var/page_cache/* var/session/*
  3. Go to any page on the storefront.
  4. Log in to the Magento Admin and browse to several pages.
  5. If no errors display, congratulations! memcached is working

Ready to foster your knowledge

with MAGENTO 2 BASIC GUIDE

Is your site still a mess and Magento extensions are not enough to save your site? Save your site with Magento Web Development Services now

magento services


How to Create Widget in Magento 2

Leave a Reply

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