Fatal Error with Database Password displayed

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Kavatah14
Registered User
Posts: 9
Joined: Sat Dec 23, 2017 5:12 pm

Fatal Error with Database Password displayed

Post by Kavatah14 »

Hi Everyone,

I have a phpBB 3.3.3 Forum, webhosted on a PHP 8.0 and MySQL 5.5 server (IONOS.COM).

Today, my forum is having a 503 unavailable error message. And sometimes, when I refresh the page, it displays the following Fatal Error :

Code: Select all

Fatal error: Uncaught Error: Call to a member function getParameter() on null in /homepages/29/<FTPFolder>/htdocs/forum/includes/functions.php:2999
 Stack trace:
 #0 [internal function]: msg_handler(2, 'mysqli_real_con...', '/homepages/29/d...', 64)
 #1 /homepages/29/<FTPFolder>/htdocs/forum/phpbb/db/driver/mysqli.php(64): mysqli_real_connect(Object(mysqli), '<DatabaseHost>....', '<DatabaseUser>', '<DatabasePassword>', '<DatabaseName>', NULL, NULL, 2)
 #2 /homepages/29/<FTPFolder>/htdocs/forum/phpbb/di/container_builder.php(580): phpbb\db\driver\mysqli->sql_connect('<DatabaseHost>....', '<DatabaseUser>', '<DatabasePassword>', '<DatabaseName>', NULL, false, false)
 #3 /homepages/29/<FTPFolder>/htdocs/forum/phpbb/di/container_builder.php(237): phpbb\di\container_builder->inject_dbal_driver()
 #4 /homepages/29/<FTPFolder>/htdocs/forum/common.php(115): phpbb\di\container_builder->get_container()
 #5 /homepages/29/<FTPFolder>/htdocs/forum/index.php(23): include('/homepages/29/d...')
 #6 {main} thrown in /homepages/29/<FTPFolder>/htdocs/forum/includes/functions.php on line 2999
The Database connection information are clearly displayed to anyone trying to access the forum ...

My WebHosting serviceis currently having some technical issues preventing people from accessing certain sites which explains the 503 error...
However, I'm more concerned by the Fatal Error displaying this kind of information.

Does anyone know what could have caused this error, and if there is a way to prevent it from displaying critical data ? Or store the connection information in a more secure location than the config.php file ?

Thank you in advance,
Regards,
Kavatah14
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Fatal Error with Database Password displayed

Post by thecoalman »

Is the error page generated by phpBB or is it a server error page?
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
Kavatah14
Registered User
Posts: 9
Joined: Sat Dec 23, 2017 5:12 pm

Re: Fatal Error with Database Password displayed

Post by Kavatah14 »

Hi thecoalman,

I'm not sure what generated this error "Fatal error: Uncaught Error: Call to a member function getParameter() on null in /homepages/29/<FTPFolder>/htdocs/forum/includes/functions.php:2999" ..
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72340
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Fatal Error with Database Password displayed

Post by KevC »

Do you mean the error page displays your actual password?
There's no info in that message you've put up that would be unsafe.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Fatal Error with Database Password displayed

Post by Paul »

That error message you provided is generated by php itself, and not phpBB. Unfortently, there is no real possibility to move the password to a more secure location, as the password need to be provided in plain text to login.
php has no knowledge that a provided argument to that feature is a password, and as such doesn't remove it, and kinda unfortently it shows it in plain text.

To solve the actual error, it might help to delete everything except .htaccess and index.htm from the cache/ directory. However, it might also be required to upgrade your phpBB to 3.3.5 as there have been a few fixes in the latest releases regarding to php8 support.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Fatal Error with Database Password displayed

Post by thecoalman »

There is directive for this in php.ini.

display_errors = Off

You can determine what the value is by going to ACP >> System tab >> php Information and look up the value under the core heading.

If you can't access to the ACP you can create your own phpinfo page, save this as anyfilename.php and upload to server. Point your browser at it.

Code: Select all

<?php
phpinfo();
?>
You'll need to consult hosts documentation on using custom php.ini settings.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
Post Reply

Return to “[3.3.x] Support Forum”