Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug magento application

I am working with Magento but i didn't find a very good way to debug my modules. For example, many time, i got a blank page with no php error and no apache error. For example, in backend, if one grid controller isn't well set, i don't have an error.

How to debug Magento module?

like image 711
Sebastien Avatar asked Sep 19 '11 16:09

Sebastien


People also ask

How do I debug an issue in Magento 2?

When an error occurs, Magento 2 logs it in the var/reports file and does not display it on the screen. However, you can get it to post the error on your screen for debugging. To do so, simply enable it from $Magento2Root/pub/errors/ directory by renaming the local. xml.


1 Answers

It sounds like you want to enable Developer mode. Add this to your .htaccess file:

SetEnv MAGE_IS_DEVELOPER_MODE "true"

You may also want to enable display errors in index.php:

 ini_set('display_errors', 1);

The best way I have found to debug is with X-Debug in a local environment. You can also use log files to help debug in a production environment, if your unable to run X-Debug in the environment.

I've got a more detailed posting here:

  • https://gist.github.com/molotovbliss/2792c6c59410d75e5baf249b76413247

Consider also installing XDebug

like image 57
B00MER Avatar answered Oct 23 '22 19:10

B00MER