EchoFool Posted April 2, 2010 Share Posted April 2, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 2, 2010 Share Posted April 2, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/#findComment-1035586 Share on other sites More sharing options...
EchoFool Posted April 2, 2010 Author Share Posted April 2, 2010 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 =/ Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/#findComment-1035639 Share on other sites More sharing options...
PFMaBiSmAd Posted April 2, 2010 Share Posted April 2, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/#findComment-1035643 Share on other sites More sharing options...
EchoFool Posted April 2, 2010 Author Share Posted April 2, 2010 What would change them ... don't know if this helps but my logs error file in my server logs stores the logs there, so the errors are saving but just won't display on the browser which would save me more time =/ Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/#findComment-1035644 Share on other sites More sharing options...
PFMaBiSmAd Posted April 2, 2010 Share Posted April 2, 2010 Someone already answered that - You must set the error_reporting/display_errors settings before your script is requested if you want to report and display fatal parse errors. Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/#findComment-1035645 Share on other sites More sharing options...
EchoFool Posted April 2, 2010 Author Share Posted April 2, 2010 But they are aren't they if they are the first line in the script ? Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/#findComment-1035646 Share on other sites More sharing options...
PFMaBiSmAd Posted April 2, 2010 Share Posted April 2, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/#findComment-1035648 Share on other sites More sharing options...
EchoFool Posted April 2, 2010 Author Share Posted April 2, 2010 Well this is heading to the unknown for me but my phpinfo has: error_append_string no value no value error_log error_log error_log error_prepend_string no value no value error_reporting 6135 If that helps at all =/ Quote Link to comment https://forums.phpfreaks.com/topic/197301-error-reporting-not-working/#findComment-1035654 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.