Piwigo spits out db pw if php-mysqli is missing #678

Open
opened 2026-10-05 00:11:09 +02:00 by adam · 1 comment
Owner

Hi there,

Yesterday i moved piwigo to a new host. on this host, php-mysqli was missing. As i called the url of gallery, i got an error message including my database password. I anonymized paths, usernames, ip-adress and of course the password for this report.

Fatal error: Uncaught Error: Class 'mysqli' not found in /export/home/foo/bar/piwigo/include/dblayer/functions_mysqli.inc.php:67
Stack trace: #0 /export/home/foo/bar/piwigo/include/common.inc.php(124): pwg_db_connect('ip-adress', 'foo', 'password', 'foo')
#1 /export/home/foo/bar/piwigo/index.php(26): include_once('/export/home/sm...')
#2 {main} thrown in /export/home/foo/bar/piwigo/include/dblayer/functions_mysqli.inc.php on line 67

Hi there, Yesterday i moved piwigo to a new host. on this host, php-mysqli was missing. As i called the url of gallery, i got an error message including my database password. I anonymized paths, usernames, ip-adress and of course the password for this report. Fatal error: Uncaught Error: Class 'mysqli' not found in /export/home/foo/bar/piwigo/include/dblayer/functions_mysqli.inc.php:67 Stack trace: #0 /export/home/foo/bar/piwigo/include/common.inc.php(124): pwg_db_connect('ip-adress', 'foo', 'password', 'foo') #1 /export/home/foo/bar/piwigo/index.php(26): include_once('/export/home/sm...') #2 {main} thrown in /export/home/foo/bar/piwigo/include/dblayer/functions_mysqli.inc.php on line 67 <!-- github-sync-id:243228662 -->
Author
Owner

I'm not too certain this is a Piwigo issue as much as it would be your PHP configuration.. Ideally you would not be delivering stack traces for exceptions to your clients; store that server-side in your php logs (were obviously if someone has access to them they could just as easily access your config file for piwigo anyway).

However it does seem like maybe an ini_set('display_errors', 0) in that common.inc.php file would be a reasonable measure to prevent this kind of thing.

I'm not too certain this is a Piwigo issue as much as it would be your PHP configuration.. Ideally you would not be delivering stack traces for exceptions to your clients; store that server-side in your php logs (were obviously if someone has access to them they could just as easily access your config file for piwigo anyway). However it does seem like maybe an `ini_set('display_errors', 0)` in that `common.inc.php` file would be a reasonable measure to prevent this kind of thing. <!-- github-comment-id:321052081 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#678