PHP Error reporting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
echofool
Forum Newbie
Posts: 16
Joined: Mon Mar 22, 2010 1:15 pm

PHP Error reporting

Post by echofool »

For some reason my error reporting doesn't display on the screen any more it just stores them in my error logs...It used to always display an error for any type of mistake now i just get white screens....
I put :

Code: Select all

<?php
session_start();
require_once($_SERVER['DOCUMENT_ROOT']."/../css/includes/bconnect45/errorreporter.php"); 
In my global header so all pages have the error reporter yet it doesn't work! This is what is in my error reporter script:

Code: Select all

<?php
ini_set('display_errors',1);
error_reporting(E_ALL | E_STRICT | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED);
?>
any idea what i got wrong ? :S
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: PHP Error reporting

Post by pickle »

Setting error reporting to just E_ALL should suffice.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
echofool
Forum Newbie
Posts: 16
Joined: Mon Mar 22, 2010 1:15 pm

Re: PHP Error reporting

Post by echofool »

So removing the strict part will make it work ?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: PHP Error reporting

Post by pickle »

Everything but the E_ALL - try it.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
echofool
Forum Newbie
Posts: 16
Joined: Mon Mar 22, 2010 1:15 pm

Re: PHP Error reporting

Post by echofool »

Hmm, no i still get white screens =/
solid
Forum Commoner
Posts: 28
Joined: Wed Aug 12, 2009 11:56 am

Re: PHP Error reporting

Post by solid »

From php.net:
Note: Although display_errors may be set at runtime (with ini_set()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed.
If you have Fatal Errors being logged, then this is why they are not being displayed.
echofool
Forum Newbie
Posts: 16
Joined: Mon Mar 22, 2010 1:15 pm

Re: PHP Error reporting

Post by echofool »

Can fatal errors be displayed ? They store in my error_logs file - some im wondering if theres some way to do it?

Hope you can help.
Post Reply