News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

HELP!!

Started by Bec, May 07, 2008, 05:25:20 PM

Previous topic - Next topic

Bec

I have just tried to access my site and am getting this error message, can someone please tell me what this means!! When i left it last night everything was fine! PLease help!!

Notice: Undefined variable: sourcedir in /home/buctai8/public_html/index.php on line 54

Warning: require_once(/QueryString.php) [function.require-once]: failed to open stream: No such file or directory in /home/buctai8/public_html/index.php on line 54

Fatal error: require_once() [function.require]: Failed opening required '/QueryString.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/buctai8/public_html/index.php on line 54

Bec

BTW I upgraded to 1.15 a few days ago and everything appeared fine, also have TP! please help!!

Bec

i also cant access my cpanel, is it possible it could be a problem with my host???

kat

When did you last make a backup of the site?

If it was recently, you might get away with uploading those files from it.

Is this related to this, by any chance?

http://www.simplemachines.org/community/index.php?topic=237026.msg1528915;topicseen#msg1528915

If you can't get into cpanel, though, it might just be your host, yeah.

Bec

Hey Kat,

That post was a few days ago but everything was resolved... everything was fine when i left it last night and I havent been having any problems with anything, no errors or anything, im hoping its something with the host considering i cant get into my cpanel to edit anything, im at work now so cant even access my ftp! and yeah i do have a recent backup! thanks for responding!

kat


MrPhil

#6
Look at Settings.php and see if it's empty or otherwise looks corrupted. If it is, copy Settings_bak.php over Settings.php. Do not simply rename Settings_bak.php -- copy it!

There is a major design flaw in SMF where the system tries to write the latest DB error code into this file (Settings.php), and once in a while two or more errors happen so close together that this file gets wiped out.

Bec

Thanks MrPhil, i cant do anything until i get home but will definately check that out! Thank you very much for your response! Im sure ill be back with more questions... :-(

Bec

Hey Guys,

I have managed to get my site back up and running... my settings.php was empty so did the changes.... the error message i was getting about line 54, this is what is on line 54 of my index.php

require_once($sourcedir . '/QueryString.php');

is there anything else i need to do, or is everything ok now?? any idea what made this happen in the first place? when i upgraded to 1.15 i got the error message that my database was still at version 1.14 but did a manual upgrade and assumed that this was all fine as i havent been getting any error messages....

any advice would be greatly appreciated!

**also im not sure if its my net connection or not, but things are taking a while to load as well.

MrPhil

$sourcedir is set in Settings.php, so if that file is gutted, $sourcedir isn't set and

require_once($sourcedir . '/QueryString.php');

evaluates as

require_once('/QueryString.php');

and that's an invalid address (path/name), as compared to the proper

require_once('/home/ACCOUNT/public_html/forums/Sources/QueryString.php');

or whatever your layout is.

Bec

ok you lost me a little there

*** do i need to change line 54 (the one i was getting the error message on) to reflect the above, but with my details?

kat

I think he was telling you that that would happen if Settings.php is missing, or empty.

MrPhil

Once you've fixed or restored your Settings.php file, you should be done. No need to manually modify any code, provided that your Settings_bak.php was a good copy (of a working Settings.php file).

Bec

okies cool, thanks for explaining! Thanks Kat and MrPhil appreciate your help! MWA

Bec

hey guys I had the same thing happen to my site again today... what do i need to do to stop it from happening again? please help i cant keep having my site crash ill end up losing members!

Cheers!

kat

You mean settings.php has changed?

Bec

yup same error message

Notice: Undefined variable: sourcedir in /home/buctai8/public_html/index.php on line 54

Warning: require_once(/QueryString.php) [function.require-once]: failed to open stream: No such file or directory in /home/buctai8/public_html/index.php on line 54

Fatal error: require_once() [function.require]: Failed opening required '/QueryString.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/buctai8/public_html/index.php on line 54

and settings.php was empty again!

kat

I wonder how it would be, if you replace the file with the original, again, but make the file write-protected...

Aleksi "Lex" Kilpinen

Quote from: Kat on May 12, 2008, 05:31:46 AM
I wonder how it would be, if you replace the file with the original, again, but make the file write-protected...
I think it would still work, but you would not be able to change the settings in it, and it would not log the last errors as it does normally.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

kat

Do you think it might help to isolate whatever's causing the error, though?

Aleksi "Lex" Kilpinen

It should prevent it yes, but I'm not sure if it would effect something else as well...
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

kat

I just wondered if it might give an error, along the lines of "Unable to write to blah-blah", which might tell us what it is that's trying to alter the file.

Aleksi "Lex" Kilpinen

Quote from: Kat on May 12, 2008, 06:01:30 AM
I just wondered if it might give an error, along the lines of "Unable to write to blah-blah", which might tell us what it is that's trying to alter the file.

It is more or less like MrPhil said.

Quote from: MrPhil on May 07, 2008, 08:37:13 PM
flaw in SMF where the system tries to write the latest DB error code into this file (Settings.php), and once in a while two or more errors happen so close together that this file gets wiped out.

SMF tries to always log the last database error to settings.php. So the cause would most probably be more or less in the database side I think...
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

kat

Ah, yeah.

That pretty-well covers it, doesn't it?

DOH!

Bec

#24
hey,

just wondering i did try and upload some smileys just after upgrading to 1.15 and it gave me the error saying my database was version 1.14 etc... could this have something to do with it?

based on everything you both just said what do you think would be the best course of action? should i make the settings.php file write protected?

thanks for the help I really appreciate it!!

Aleksi "Lex" Kilpinen

Quote from: Bec on May 12, 2008, 06:23:43 AM
just wondering i did try and upload some smileys just after upgrading to 1.15 and it gave me the error saying my database was version 1.14 etc... could this have something to do with it?
Should not effect.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Bec

ok cool thanks, any ideas on what i should do to fix this problem?

forum error log shows

8: Undefined offset: 533
File: /home/buctai8/public_html/Themes/default/languages/Post.english.php (main sub template - eval?)
Line: 891

8: Undefined offset: 532
File: /home/buctai8/public_html/Themes/default/languages/Post.english.php (main sub template - eval?)
Line: 890

while cpanel error log shows

[Mon May 12 05:03:44 2008] [error] [client 122.107.46.173] File does not exist: /home/buctai8/public_html/404.shtml
[Mon May 12 05:03:44 2008] [error] [client 122.107.46.173] File does not exist: /home/buctai8/public_html/favicon.ico
[Mon May 12 04:25:13 2008] [error] [client 119.11.37.118] File does not exist: /home/buctai8/public_html/404.shtml
[Mon May 12 04:25:13 2008] [error] [client 119.11.37.118] File does not exist: /home/buctai8/public_html/favicon.ico
[Mon May 12 04:25:01 2008] [error] [client 119.11.37.118] File does not exist: /home/buctai8/public_html/404.shtml
[Mon May 12 04:25:01 2008] [error] [client 119.11.37.118] File does not exist: /home/buctai8/public_html/favicon.ico
[Mon May 12 03:18:39 2008] [error] [client 122.109.115.219] File does not exist: /home/buctai8/public_html/404.shtml
[Mon May 12 03:18:39 2008] [error] [client 122.109.115.219] File does not exist: /home/buctai8/public_html/favicon.ico
[Mon May 12 02:48:25 2008] [error] [client 194.153.113.18] File does not exist: /home/buctai8/public_html/404.shtml
[Mon May 12 02:48:25 2008] [error] [client 194.153.113.18] File does not exist: /home/buctai8/public_html/robots.txt

and just finally i never had any trouble before upgrading to 1.15 could that have done something?

Aleksi "Lex" Kilpinen

Do you have any mods installed?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Bec

yup! tinyportal as well




Bec

#29
i dont have uninstall options for :-

tinyportal
PaypalDonations - im pretty sure i got an error message during install so was never installed
SMF 1.0.13 / 1.1.5 / 2.0 b3.1 Update - this was done manually though
MessagePreviewOnHover

felblog isnt installed either, as i received some error messages during install

Aleksi "Lex" Kilpinen

Autsch.. With that many mods, the update could have caused something to go wrong.

But the undefined offsets might be from fontandsizedropdown

Check your Themes/default/languages/Post.english.php
does it have in it:

$txt[532] = 'Font Size';
$txt[533] = 'Font Face';

If not, you might want to try and add them there.
That should take care of the offset errors.

The cpanel errors are nothing to worry about I think, search engines ask for robots.txt
that you don't have, and many browsers ask for favicon.ico which you don't have...
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Bec

LexArma, cheers! ill give that a shot! thank you!

Bec

no they arent mentioned in there....

should i just put them in between....

$txt[448] = 'Subscript';
$txt[449] = 'Insert Table Row';
$txt[499] = 'Your message is too long. Please go back and shorten it, then try again.';
$txt[531] = 'Horizontal Rule';
$txt[532] = 'Font Size';
$txt[533] = 'Font Face';

$txt['font_face'] = 'Font Size';
$txt['font_arial'] = 'Arial';
$txt['font_times'] = 'Times New Roman';
$txt['font_comic'] = 'Comic Sans MS';
$txt['font_verd'] = 'Verdana';

Aleksi "Lex" Kilpinen

Yeah, that should be good. :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Bec

great thank you, i really appreciate your help!  ;D

Aleksi "Lex" Kilpinen

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Bec

Im back!!! Just bought my site up and im getting the same error message again!!  :'(

Notice: Undefined variable: sourcedir in /home/buctai8/public_html/index.php on line 54

Warning: require_once(/QueryString.php) [function.require-once]: failed to open stream: No such file or directory in /home/buctai8/public_html/index.php on line 54

Fatal error: require_once() [function.require]: Failed opening required '/QueryString.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/buctai8/public_html/index.php on line 54


This is what is on line 54 - $db_last_error = 1209795132;

Does anyone have any idea what is constantly causing this error message and making my site crash? And most importantly how can I stop this from happening every couple of days?!?

Cheers,
Bec

MrPhil

Quote from: Bec on May 12, 2008, 06:32:25 AM
while cpanel error log shows

[Mon May 12 05:03:44 2008] [error] [client 122.107.46.173] File does not exist: /home/buctai8/public_html/404.shtml
[Mon May 12 05:03:44 2008] [error] [client 122.107.46.173] File does not exist: /home/buctai8/public_html/favicon.ico
...
[Mon May 12 02:48:25 2008] [error] [client 194.153.113.18] File does not exist: /home/buctai8/public_html/robots.txt

You should have the following files in your site root (public_html/): 400.shtml, 401.shtml, 403.shtml, 404.shtml, 500.shtml, favicon.ico, robots.txt. The first 5 are "error documents". If you have cPanel, there's a button for creating them. "favicon.ico" is the little icon you see in the browser address bar, in bookmarks/favorites, and in browser tabs. You can make one with many image editing programs, or just borrow one from someone else (with permission, of course). Every browser tries to get one from your site, and gives a 404 error if you don't have one. Finally, "robots.txt" is a control file requested by every search engine spider. An empty file named "robots.txt" will do to suppress the error message and associated 404 error.

Getting these files will greatly cut down the clutter in your error log.

MrPhil

Quote from: Bec on May 17, 2008, 05:16:33 PM
This is what is on line 54 - $db_last_error = 1209795132;

That's the timestamp of the last database error reported. Why don't you try the fix I proposed here and let us know if it works for you. Since you're having frequent DB failures, it shouldn't take too long to see how it does. If it doesn't work correctly, perhaps we can take it offline via PMs (or in the other thread) until I get the code working right.

Bec

#39
Quote from: MrPhil on May 17, 2008, 10:01:18 PM
Quote from: Bec on May 12, 2008, 06:32:25 AM
while cpanel error log shows

[Mon May 12 05:03:44 2008] [error] [client 122.107.46.173] File does not exist: /home/buctai8/public_html/404.shtml
[Mon May 12 05:03:44 2008] [error] [client 122.107.46.173] File does not exist: /home/buctai8/public_html/favicon.ico
...
[Mon May 12 02:48:25 2008] [error] [client 194.153.113.18] File does not exist: /home/buctai8/public_html/robots.txt

You should have the following files in your site root (public_html/): 400.shtml, 401.shtml, 403.shtml, 404.shtml, 500.shtml, favicon.ico, robots.txt. The first 5 are "error documents". If you have cPanel, there's a button for creating them. "favicon.ico" is the little icon you see in the browser address bar, in bookmarks/favorites, and in browser tabs. You can make one with many image editing programs, or just borrow one from someone else (with permission, of course). Every browser tries to get one from your site, and gives a 404 error if you don't have one. Finally, "robots.txt" is a control file requested by every search engine spider. An empty file named "robots.txt" will do to suppress the error message and associated 404 error.

Getting these files will greatly cut down the clutter in your error log.

Just had a look and i dont have any of those files you mentioned...... 

**update ok, ive just found the error pages you are talking about, just created 404 do i just leave these blank?

**update i have just created a favicon.ico file and uploaded and have also created an empty robots.txt and uploaded... Cheers!

Bec

Quote from: MrPhil on May 17, 2008, 10:08:40 PM
Quote from: Bec on May 17, 2008, 05:16:33 PM
This is what is on line 54 - $db_last_error = 1209795132;

That's the timestamp of the last database error reported. Why don't you try the fix I proposed here and let us know if it works for you. Since you're having frequent DB failures, it shouldn't take too long to see how it does. If it doesn't work correctly, perhaps we can take it offline via PMs (or in the other thread) until I get the code working right.

ok ill give it a go and keep you informed! cheers!

MrPhil

Quote from: Bec on May 18, 2008, 01:09:13 AM
**update ok, ive just found the error pages you are talking about, just created 404 do i just leave these blank?

I wouldn't have a blank 404.shtml. That file is HTML code to display a page telling a visitor what went wrong when they tried to access something, so a blank one would not be good. It's just a simple HTML page with some server side includes (thus the ".shtml" extension) to give information on what page was requested, etc. You can start with the template produced by cPanel and go from there. You can also use PHP or plain HTML, but then you need to add ErrorDocument 404 name-of-file to your .htaccess file.

MrPhil

Quote from: Bec on May 18, 2008, 01:11:41 AM
Quote from: MrPhil on May 17, 2008, 10:08:40 PM
Quote from: Bec on May 17, 2008, 05:16:33 PM
This is what is on line 54 - $db_last_error = 1209795132;

That's the timestamp of the last database error reported. Why don't you try the fix I proposed here and let us know if it works for you. Since you're having frequent DB failures, it shouldn't take too long to see how it does. If it doesn't work correctly, perhaps we can take it offline via PMs (or in the other thread) until I get the code working right.

ok ill give it a go and keep you informed! cheers!

Great! I need some feedback on whether my code works for real DB errors, and since you seem to have frequent DB errors, your site would be the perfect testbed. Something you might do is set up a cron job to email you the content of /LastError.php every couple of hours, to see if it's changing and if it's correctly updated. The cron job command would be cat /home/buctai8/public_html/forum/LastError.php (adjust to reflect your file structure). Feel free to PM me to take this offline if you wish.

xrunner

Whew! This thread just saved my butt! Had to copy the backup settings.php which fixed it. Nasty!

MrPhil

Bec, did you get a chance to try my changes? Did they help at all? Monitoring the content and date of LastError.php, do you see that it's being updated on any regular basis? Most importantly, has your forum stopped crashing because Settings.php got wiped out?

I sent you a PM after a week or so, but you didn't respond. I'd really like to get some feedback on whether this work fixes a very nasty and longstanding problem, and I'm sure the developers would like to know too. Thanks!

Bec

Phil apologies I havent received any pm. Sorry i havent tried your changes as everything has been fine lately, seems everything was fixed when i did the error files and favicon... sorry!

MrPhil

Interesting. I guess it's yet another thing broken in SMF 2 (did you go into My Messages > Read Your Messages? SMF no longer tells you that you have unread messages).

Anyway, glad to hear that the other stuff fixed the problem (though I can't figure out how). Maybe your host fixed a glitch in MySQL or PHP at the same time (no more DB errors) and it's just coincidence?

Bec

ive received other pm's but nothing from yourself, so maybe.

thanks. maybe coincidence, im not sure im just glad its stop crashing! thanks again for your help

Advertisement: