25

I have installed Magento Community edition and tried creating my first simple hello world module. After a few hours I finally got it working.

My issues were I had used incorrect casing in some of the XML tags.

While trying to get it to work I tried to load the page a not found message was displayed, but no error.

I have switched errors on in the admin control panel System > Configuration > Developer > Log Settings and wrote a line which I know should have thrown an error but I just got a blank screen

  1. How do I get errors to display in Magento?
  2. Is it considered an error when I use incorrect casing in an xml file or is that an issue where I would not receive an error message? And if that is the case how would I quickly find the file that is causing the issue (obviously not a problem at the moment, but I can imagine as the module become functional it will be hard to find a single casing issue that is causing the problem)
Waqleh
  • 9,741
  • 8
  • 65
  • 103
tony09uk
  • 2,841
  • 9
  • 45
  • 71

4 Answers4

46

For enable error reporting

In Index page change the following:

error_reporting(E_ALL | E_STRICT);

to

error_reporting(E_ALL);

Set $_SERVER['MAGE_IS_DEVELOPER_MODE'] = true

and uncomment this line

#ini_set('display_errors', 1);

In Errors folder rename local.xml.sample to local.xml.

hope this help.

Manashvi Birla
  • 2,837
  • 3
  • 14
  • 28
Pankaj Pareek
  • 3,806
  • 2
  • 31
  • 42
  • That has helped start the error messages thanks.Is it possible to set something that will help me locate the source of the problem when I use incorrect casing in an xml file? e.g. using frontName the required page is returned, using frontname returns a page not found message, this simple thing had me pulling my hair out! – tony09uk Jun 17 '13 at 09:31
  • If you're running on Linux, you have xmllint to help ferret out layout xml file mistakes and malformation. – Fiasco Labs Jun 17 '13 at 19:35
  • 1
    @tony09uk, please accept answer if it satisfies You. – Line Aug 04 '14 at 08:45
  • 6
    The first change **decreases** error reporting. Setting dev mode should be done outside of Magento, e.g. using `SetEnv` in your `.htaccess` file. – Walf Sep 09 '14 at 03:50
18

to complete the pankaj post, this work for me index.php

ini_set('display_errors', 1);
error_reporting(E_ALL);

$_SERVER['MAGE_IS_DEVELOPER_MODE'] = true;
masoud2011
  • 896
  • 9
  • 10
2

Here are the steps that you should do in order to set Magento to display errors on the browser:

  1. System > Cache Management > Disable All
  2. System > Configuration > Advanced > Developer > Log Settings > Enabled => Yes
  3. System > Configuration > Web > Search Engine Optimization > Use Wbe Server Rewrites => Yes
  4. System > Index Management > Reindex All
  5. Open .htaccess and set: SetEnv MAGE_IS_DEVELOPER_MODE "true" at the end of the file
  6. Open .htaccess and set: php_value display_errors On somewhere within
  7. Rename or copy /errors/local.xml.sample to /errors/local.xml
Waqleh
  • 9,741
  • 8
  • 65
  • 103
1

Modifying this code in magneto directory index.php:

Search for error_reporting(E_ALL | E_STRICT);

Replace with

error_reporting(E_ALL);
$_SERVER['MAGE_IS_DEVELOPER_MODE'] = true;

OR Uncomment it by removing the # sign from

#ini_set('display_errors', 1);

Refereed Link: http://www.templatemonster.com/help/magento-how-to-display-error-messages.html

Mayuso
  • 1,291
  • 4
  • 19
  • 41
Rajesh Baskaran
  • 322
  • 1
  • 11