News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Connection problems

Started by FaHoody, August 23, 2014, 03:34:29 PM

Previous topic - Next topic

FaHoody

Hello,

Since a few days, my website stopped working. Whenever I try to access to it, I get the following message:

Connection Problems

Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.


My website is hosted by hxxp:hosting24.com [nonactive], I tried to ask them for support and they replied with the following:

"It seems that your script failed to connect database. Please check whether it is using the correct details. You may find your database information at cPanel > Database > MySQL section.
For further help you may check http://wiki.simplemachines.org/smf/Settings.php"

Since I have no real technical background in that stuff, I would not like to make it worse. Could you please forward any help?

Thanks!

kat

Welcome to the forum, doooood! :)

If everything worked, yet now doesn't, I have to suspect that something changed.  If you didn't change anything, your host must have. Upgraded PHP? Upgraded their server?  If you know the database details, such as username/database name/password, you could try this, to check those:

http://wiki.simplemachines.org/smf/Repair_settings.php

But, I have to say, I think your host might be telling porkies.

If they upgraded the server, it's quite likely that you don't have proper CHOWN ownership of your files, or they have mod_security enabled, when it wasn't, previously.

Illori

Quote from: K@ on August 23, 2014, 03:46:26 PM
If they upgraded the server, it's quite likely that you don't have proper CHOWN ownership of your files, or they have mod_security enabled, when it wasn't, previously.

but those would not give a database connection error as they have nothing to do with the database.

kat

**sigh**

They were "For example".

Plus, of course, if Settings.php isn't owned, it might not be readable.

Illori

if Settings.php is not readable, you would get a different error message completely.

kat

You're really not getting it.

Never mind, eh?

NanoSector

K@, Illori is right in this case.

Settings.php is required by SMF (there's a difference between requiring and including in PHP, the former kills execution upon failure while the latter just throws a warning) before a database connection is set up. Because of that, if Settings.php would not be readable by whoever PHP is running as, PHP would throw a Fatal Error instead (because the file is *required*, not just included).

However, if SMF got this far to the point it throws this error, that means it has loaded Settings.php and all ciritically required files and attempted to initiate a database connection.

All technical details aside, @OP, your hosting control panel shows you the information required to make a successful connection to the database. Enter this information in either Repair_settings.php or directly into Settings.php and SMF should be able to connect.

On a sidenote, Hosting24 is the paid equivalent to 000webhost which, lets just say, doesn't have a good reputation around.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

kat

Yes, taken literally, she is.

But, I was using "For examples". :)

Advertisement: