All posts by Pramod T P

Configure Memcached Magento 2

Memcached is an open-source memory object caching system that web sites can use to help accelerate page load times. Memcached works by caching in RAM frequently accessed data, such as the results of API calls, database calls, and more.

Click here to undersatnd how to configure memcached in XAMPP – WIndows 10

To enable memcached for Magento 2, you need to change some settings in the env.php file. To do this, follow these steps:

1) Open the file app/etc/env.php

2) Locate the following section in the env.php file:
‘session’ =>
array (
‘save’ => ‘files’,
),
Modify this section as follows:

‘session’ =>
array (
‘save’ => ‘memcached’,
‘save_path’ => ‘127.0.0.1:11211’
),

3)Save your changes to the env.php file.

4) Edit the php ini.file

Seacch for the string in php.ini file ‘session.save_handler=files’ and update it to ‘session.save_handler=memcached’

Now memcached is enabled for you magento site

Unable to load dynamic library ‘xampp\php\ext\php_memcache.dll’

I have configured Memcached in XAMPP running onwindows 10. But the module was not appearing in phpinfo() data.

The system was throwing the following error.

PHP Warning: PHP Startup: Unable to load dynamic library ‘xampp\php\ext\php_memcache.dll’ – The specified module could not be found

The issue was due to the fact that the php_memcache.dll downloaded was not mathcing with the PHP version(7.1.14) that I have been using.

Later I downloaded the correct php_memcache.dll file from https://codeload.github.com/nono303/PHP7-memcache-dll/zip/master

Install Memcache XAMPP Windows 10

Memcache is a caching system used to speed up web applications by holding small pieces of arbitrary data, it could be broadly compared to the $_SESSION variable in PHP, but memcache works across the whole application not just on a per user basis and has been successfully proven to make great gains in speed increases on web applications.

Memcache was designed with Linux in mind and not windows, so it has posed some installation issues because Windows users are not so familiar with having to compile code from source as memcache does not come with any installation software. Continue reading Install Memcache XAMPP Windows 10

Remove header and footer Magento 2

You can remove header and footer content from all the Magento pages by adding the following code in default layout xml file.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <body>
<referenceContainer name="header.container" remove="true" />
 <referenceContainer name="footer" remove="true" /> 
 </body>
</page>

For example in case of the theme Luma, the file need to be edited is vendor\magento\theme-frontend-luma\Magento_Theme\layout\default.xml

Check out the extension to that removes the header and footer content.