Posted in:
Magento 2 Tutorials
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:
- 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
- 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.
- 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.
where, {type} can be “html” or “csvfile”.SetEnv MAGE_PROFILER {type}
- 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?