fatal_error always shows error / backtrace, no matter how show_php_errors_on_frontend / show_php_errors are set #1866

Open
opened 2026-10-05 00:59:09 +02:00 by adam · 0 comments
Owner

When a fatal error occurs (function fatal_error), Piwigo will apparently always display an error page with an error message and a backtrace.
(The php configuration options display_errors and) the local config options show_php_errors_on_frontend / show_php_errors seem to be ignored in this case.

This is apparently because the function signature is function fatal_error($msg, $title=null, $show_trace=true), and all (?) callers only pass the first argument.

This could be a security concern (I guess?), a lot of web hosting guides recommend to switch off displaying PHP errors on the frontend. I would prefer to just have a generic "Internal Server Error" be displayed (especially with the config options set as they are).

I encountered this when I set up a separate PHP pool, running it as a separate user, after I already set up Piwigo. As a result, the _data directory contents were not writable, and Piwigo was complaining about this.

Piwigo version: 14.3.0

When a fatal error occurs (function `fatal_error`), Piwigo will apparently always display an error page with an error message and a backtrace. (The php configuration options `display_errors` and) the local config options `show_php_errors_on_frontend` / `show_php_errors` seem to be ignored in this case. This is apparently because the function signature is `function fatal_error($msg, $title=null, $show_trace=true)`, and all (?) callers only pass the first argument. This could be a security concern (I guess?), a lot of web hosting guides recommend to switch off displaying PHP errors on the frontend. I would prefer to just have a generic "Internal Server Error" be displayed (especially with the config options set as they are). I encountered this when I set up a separate PHP pool, running it as a separate user, after I already set up Piwigo. As a result, the `_data` directory contents were not writable, and Piwigo was complaining about this. Piwigo version: 14.3.0 <!-- github-sync-id:2244456830 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1866