News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

missing settings.php file

Started by jay.clark, December 01, 2009, 01:45:16 PM

Previous topic - Next topic

jay.clark

I am in the process of setting up a new system with RC2.

Things were going pretty swimingly until this morning when I attempted to log in and do an update.

Got an error message Warning:  require_once(/internal Settings.php)   

So I went into the site and sure enough no settings.php file.

At this point I am not sure if this is something I did, or potentially someone came in and hacked the site.

What I would like to know is if there is some way of recovering from this without wiping out everything and starting over.

Perhaps starting over is not a bad idea, will learn much more the 2nd time around, but it would mean about a week of lost work in customization.

jayr
SMF 1.11- SMF 2.0 RC2/RC3 - - RSS Feed Poster 2.2,RSS Feeder 1.1.4, Downloads System Pro 1.0.17.1, SMF Classifieds 1.3.5, SMF Gallery Pro 3.0.2, SimpleDesk - Integrated Helpdesk for Simple Machines Forum 1.0 Felidae, Aeva Media 1.1b, Ultimate Profile     0.9, Google Analytics Code 1.1, Twitter and Facebook Publisher mod 2.4, Stop Spammer 2.3.7, SMF Links 2.2, Site map 2.1.2, AjaxChat Integration 3.2.1, Ad Management 2.3.6

SMF (Donated) SMF Links (donated) - Ad Manager (donated) - phpMyChat (donated)

hadesflames

You can restore your Settings_bak.php which should contain your proper settings.

If you don't have Settings_bak.php you can upload a clean Settings.php file from the install pack, then use repair_settings.php to fill in the blanks. The script should recommend the appropriate values for each field.

What is repair_settings.php?

Then open your Settings.php file and remove

header('Location: http' . (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 's' : '') . '://' . (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST']) . (strtr(dirname($_SERVER['PHP_SELF']), '\\', '/') == '/' ? '' : strtr(dirname($_SERVER['PHP_SELF']), '\\', '/')) . '/install.php'); exit;

}


Hope this helps.

jay.clark

Quote from: hadesflames on December 01, 2009, 03:06:08 PM
You can restore your Settings_bak.php which should contain your proper settings.
Hope this helps.

I did not find a setting_bak file, I tried uploading a clean settings.php from the install pack, and had limted success with that due to reports of a number of other files being missing.

In the end I bit the bullet and did a fresh upload and am starting the rebuild again.

My concern at this point is why this happened, I have been doing SMF since about forever and have never seen this happen before.

I kinda suspect that it was something that I did and did not notice at the time.

Two potential cures for future problems, I guess I could make use of the automatic backups that my hosting service does, second would be to figure out a way to do my own backups on line.

In any event thanks for your suggestions

JayR
SMF 1.11- SMF 2.0 RC2/RC3 - - RSS Feed Poster 2.2,RSS Feeder 1.1.4, Downloads System Pro 1.0.17.1, SMF Classifieds 1.3.5, SMF Gallery Pro 3.0.2, SimpleDesk - Integrated Helpdesk for Simple Machines Forum 1.0 Felidae, Aeva Media 1.1b, Ultimate Profile     0.9, Google Analytics Code 1.1, Twitter and Facebook Publisher mod 2.4, Stop Spammer 2.3.7, SMF Links 2.2, Site map 2.1.2, AjaxChat Integration 3.2.1, Ad Management 2.3.6

SMF (Donated) SMF Links (donated) - Ad Manager (donated) - phpMyChat (donated)

Norv

That's odd. Files don't just disappear. Was your forum working when you say in the original post you wanted to login and do an update, or did you start doing some update (what update?) and then it happened?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Advertisement: