Toggle Nav
My Cart 0

Magento 2 Enable Profiler - MAGE_PROFILER

Magento 2 Enable Profiler - MAGE_PROFILER

Magento 2 Enable Profiler - MAGE_PROFILER

This post instructs you to enable or disable profiler in Magento 2. You can analyze the performance of the code using built-in profiler in magento 2.

There are three techniques to enable the Profiler in Magento 2:

  1. Enable or disable it from CLI:
    • Login into your magento server.
    • Go to the magento root directory
    • To enable the profiler using html type, enter the following command.For enable
      bin/magento dev:profiler:enable html
    • Flush your magento cache from the admin and refresh any page of your website to view the profiler. you can see the profiler at the bottom of the page.
    • To disable the Profiler,
      bin/magento dev:profiler:disable
  2. Enable or disable from index.php
    • Login into your magento FTP server.
    • Go to the magento root directory
    • Open the index.php file
    • To enable the profiler using html type, enter the following line at the top in index.php.
      $_SERVER["MAGE_PROFILER"]="html";
    • Flush your magento cache from the admin and refresh any page of your website to view the profiler. you can see the profiler at the bottom of the page.
    • Simply remove the line from index.php to disable the profiler.
  3. Enable or disable from .htaccess
    • Login into your magento FTP server.
    • Go to the magento root directory
    • Open the .htaccess file
    • To enable the profiler using html type, enter the following line in .htaccess.
      SetEnv MAGE_PROFILER {type}
      where, {type} can be “html” or “csvfile”.
    • Flush your magento cache from the admin and refresh any page of your website to view the profiler. you can see the profiler at the bottom of the page.
    • Simply remove the line from .htaccess to disable the profiler.
July 7, 2018
Did you like this post?
0
0