Does Magento 2 have a profiler? The

Stores -> Settings -> Configuration -> Developer -> Debug

panel still exists, but there's no settings for a profiler there.

If Magento 2 does have a profiler, is it configurable via the GUI?

If it's not configurable with the GUI, how do you enable it?


3 Answers 3


To trigger built-in Magento2 profiler, just add a SetEnv MAGE_PROFILER "html" to your .htaccess. You can also use "csvfile" or "firebug". In case of CSV, you'll find it in your var/log.


From v2.2.4 and above

From version 2.2.4 you can now enable/disable Profiler from the CLI :

# Enable the profiler.
bin/magento dev:profiler:enable
# Disable the profiler.
bin/magento dev:profiler:disable

Source : Magento 2/Adobe Commerce documentation

For older versions

If you are running on a server with nginx (with fastcgi) :

Put this code on the PHP entry point

fastcgi_param  MAGE_PROFILER  html;

Using Magento 2 nginx.conf.sample file config, you would have a node like :

# PHP entry point for main application
location ~ (index|get|static|report|404|503|health_check)\.php$ {
    try_files $uri =404;
    fastcgi_pass   fastcgi_backend;
    fastcgi_buffers 1024 4k;
    # Profiler
    fastcgi_param  MAGE_PROFILER  html;

    fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
    fastcgi_param  PHP_VALUE "memory_limit=756M \n max_execution_time=18000";
    fastcgi_read_timeout 600s;
    fastcgi_connect_timeout 600s;

    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;

By adding the below code to the root folder index.php works for me

  • This doesn't seem to work. Commented Jun 13, 2016 at 14:15
  • 1
    this is the tricky solution
    – Amit Bera
    Commented Apr 12, 2017 at 7:41
  • worked..thanks :) Commented Jul 29, 2019 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.