There is so much static around this it's hard to find an answer that actually applies, so my apologies if there is an answer for this, I just haven't been able to find it.
My situation is that I want to display errors from our application on the page when they happen... in our DEVELOPMENT environment.... I don't need to be told to only send them to the logs, it's a giant waste of time during dev and not near as formatted to have to read them out of the logs. We of course turn this off in production.
My errors ARE being logged, this is not the problem, the issue is, they are not being DISPLAYED before Apache redirects them with a 503 response code, most likely because of PHP/FPM dying with a fatal error that we didn't catch properly.
Prior to moving to PHP-FPM, any kind of error was displayed no problem, we have the standard settings in place in /etc/php.ini
...
error_reporting = E_ALL
error_display_errors = On
display_startup_errors = On
log_errors = On
And my exception/error handler was working great, I could access my stack trace details, extra meta, etc., however now that I've got PHP-FPM enabled, Apache seems to be capturing the returning http 503 status, and is redirecting to the generic apache error message. I've tried using...
errordocument 503 /error.php?...
... but this loses state so I don't get all the details I would normally have gotten in the shutdown
handler I normally use. I've added the following to the FPM pool definition...
php_admin_flag[display_errors] = On
php_admin_flag[log_errors] = On
... but they had no effect. php_info()
is showing both master and local values are working as expected, so it's not a misconfiguration, or errant include file somewhere.
What am I doing wrong, how can I stop apache from forwarding to it's own error handler and just display the output of PHP-FPM, and by extension my own error handler?
Apache: 2.4.37-21
PHP/FPM: 7.3.5-5
0 Answers