user-avatar
Today is Friday
November 22, 2024

October 29, 2009

How to enable error reporting in drupal

by viggy — Categories: drupal, tech, web — Tags: , , , 2 Comments

Courtsey: http://drupal.org/node/158043
Enable Error Reporting

Although it may be turned off on commercial hosts and production sites (for good reason, so that users do not see the errors), these errors are one of your best tools for troubleshooting. To enable error reporting, temporarily edit your index.php file (normally located in your root directory) directly after the first opening PHP tag (do not edit the actual file info!) to add the following:

<?php

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

// $Id: index.php,v 1.94 2007/12/26...

You will now be able to see any errors that are occurring directly on the screen. Memory problems may still not be displayed, but it’s the first step in a process of elimination.

If you are using a multi-site setup and only want errors to appear for one site, then check the name of the host first as in:

2 Comments »

  1. Thanks a lot! Very simple but I forgot it and found it here. This is also helpfully to develop Themes in Drupal 7. Simply paste these lines at the beginnig of the template file (template/page.tpl.php, node.tpl.php)

  2. […] How to enable error reporting in drupal October 2009 1 comment 4 […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>