Closed louishot closed 5 months ago
What about the error_reporting
directive?
It looks like FlightPHP checks if the error level is within the error_reporting
directive with a bitwise operation, and then calls the handler function for Exceptions:
public function handleError($errno, $errstr, $errfile, $errline) {
if ($errno & error_reporting()) {
throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
}
}
So, if you really don't want any kind of error to be shown, you probably should set error_reporting=0
in your php.ini. Not sure though.
+1 Tested, specially when you try to render a PHP file (Flight::render). It just wont load, but it has error inside of it. If file has error outside of the framework, it shows errors correctly but render function gives blank page.
Good to know, thanks for verifying this!
Now that unit testing coverage is at 100%, finding stuff like this and accepting pull requests will be much easier.
On Wed, Jan 3, 2024 at 1:54 PM Kristaps @.***> wrote:
+1 Tested, specially when you try to render a PHP file (Flight::render). It just wont load, but it has error inside of it. If file has error outside of the framework, it shows errors correctly but render function gives blank page.
— Reply to this email directly, view it on GitHub https://github.com/flightphp/core/issues/483#issuecomment-1875959090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARW5LZMKGJERYGULGDXJE3YMXARVAVCNFSM6AAAAAAVWJN3CCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZVHE2TSMBZGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Error reporting works when you use Flight::Render for all the files that you have. For me, the fix was to use the renderer for all files that should be used. I will close this for now. If someone still has an issue with this, please create a new issue ticket.
I have configured
display_errors = Off
in php.ini but flight still output details of 500 Internal Server Error