You are here

  1. Blogs
  2. » charles's blog

Enabling PHP error messages in drupal

Drupal 6 has many enhancements over Drupal 5. The most useful being Drupal 6 can respect your php.ini and suppress fatal error messages and just return a nice polite site off-line message like the one pictured below.


Uninformative Error

Uninformative Error

Of course this can be a huge pain in the arse if you need to know what's wrong with your site. It's really annoying if you don't have administrative access to your hosting. It's even more annoying if you are the administrator and you forgot you set [code lang=php]display_errors = Off[/code] in your php.ini, or didn't realise Drupal 6 was being extra helpful.

There is fortunately a remedy for this on a per-site basis. One can set the following in settings.php:

[code language="php"]ini_set('display_errors', 1);[/code]

Subsequently the missing error messages should appear as shown below:


Informative Drupal Error

Informative Drupal Error

The function _db_error_page() is where the magic happens.

Subject: 

Comments

Error

I hate the word error. It not only shows that i was incapable of something, but this word itself annoys me. The way it stares in your eyes, as if its laughing at you. Bah.
When my site was offline (geboortekaartje) it just showed ERROR and a code. Wish i had drupals easy and usefull plugin so it showed some nice messages instead of the harsh Error sign

Add new comment

BBCode, html and code systax highlighting

  • Allowed HTML tags: <a><img> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><strike><hr>
  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text. URLs will automatically be converted to links.

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

My Band

LinuxCounter.net

Creative Commons License
Except where otherwise noted, work is licensed under a Creative Commons Licence and is the work and opinion of the credited author(s).

Powered by Drupal

My Facebook


Charles Elwood's Facebook profile