Learn how to configure and use Magento Memcached for both version 2.0 and older versions.
Build your Amazon-like multi-vendor marketplace website @ $249/- now!!!
Configure the Magento Memcached
To enable configure Memcached for Magento 2, you must change some settings in the env.php file. To do this, follow these steps:
Step 1: Using your preferred text editor, navigate to the directory where you installed Magento, and then open the app/etc/env.php
Step 2: Locate the following section in the PHP file:
'session' => [
'save' => 'files'
],
Step 3: Modify this section as follows:
'session' => [
'save' => 'memcached',
'save_path' => '127.0.0.1:11211'
],
Step 4: Save your changes to the env.php file. Memcached is now enabled.
Enabling Memcached with a preferred text editor
To enable Memcached for Magento 1.9 and older versions, you need to add some settings to the local.xml file. To do this, follow these steps:
Step 1: Using your preferred text editor, navigate to the directory where you installed Magento, and then open the app/etc/local.xml
Step 2: Add the following lines just before the closing </global> tag:
<cache>
<backend>memcached</backend>
<memcached>
<servers>
<server>
<host><![CDATA[127.0.0.1]]></host>
<port><![CDATA[11211]]></port>
<persistent><![CDATA[1]]></persistent>
</server>
</servers>
<compression><![CDATA[0]]></compression>
<cache_dir><![CDATA[]]></cache_dir>
<hashed_directory_level><![CDATA[]]></hashed_directory_level>
<hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
<file_name_prefix><![CDATA[]]></file_name_prefix>
</memcached>17. </cache>
Step 3: Save your changes to the local.xml file. Memcached is now enabled.
By following these steps, Magento 2 Memcached can be configured.
For more Magento Kb, visit Webnexs Knowledge Base.
Contact us to know about the Magento store development here today!!!
Leave a Reply