Jump to content

Error reporting not working


EchoFool

Recommended Posts

Hey,

 

i have error reporting on maximum / strict yet i get white screens for even the simplest mistakes in PHP...

 

I put this:

<?php
ini_set('display_errors',1);
error_reporting(E_ALL | E_STRICT | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED);
?>

 

And isn't doing jack all for me. For example i missed out a } symbol usually you get "unexpected end" error but i get a white screen! Any one know why?

Link to comment
https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/
Share on other sites

Since your code is never executed when there is a fatal parse error (php is a parsed, tokenized, interpreted language), how would the lines of code to set the error_reporting/display_errors settings ever get executed?

 

You must set the error_reporting/display_errors settings before your script is requested if you want to report and display fatal parse errors.

The ini set is line 1 and error reporting is line 2 of my script though which are in an include to the script that contains the error.

 

For example:

<?php
include(error.php); //this contains what u see in post one - which is error free
$var = 0;
If($Var == 1){

?>

 

This used to give "unexpected end but it doesn't any more =/

Then those settings where in your master php.ini or a local php.ini (when php is running as a CGI application) or in a .htaccess file (when php is running as an Apache Module) and they got changed because that is the only way you can have fatal parse errors reported and displayed.

Someone already answered that as well -

Since your code is never executed when there is a fatal parse error (php is a parsed, tokenized, interpreted language), how would the lines of code to set the error_reporting/display_errors settings ever get executed?

 

Have you used a phpinfo() statement to find out what the actual settings are at the time your script is requested, due to any master php.ini/local php.ini/.htaccess settings?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.