Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: romanov on July 07, 2004, 11:23:22 PM

Title: settings.php is 0 bytes
Post by: romanov on July 07, 2004, 11:23:22 PM
http://forum.capefeare.com

This happened twice already. Suddenly the settings.php becomes 0 bytes, and the forum is not acessible.

Please help.

Thanks in advance.
Title: Re: settings.php is 0 bytes
Post by: [Unknown] on July 08, 2004, 03:51:36 AM
Is there any chance I can see a phpinfo.php?  Just create a file with the following contents:

<?php phpinfo(); ?>

There is actually sanity code in there to prevent ever making the file less than something like 10 lines.

-[Unknown]
Title: Re: settings.php is 0 bytes
Post by: romanov on July 08, 2004, 11:52:23 AM
I don't really understand what you said. Do you mean make a php file called phpinfo.php and add <?php phpinfo(); ?> in the file or was it something else?
Title: Re: settings.php is 0 bytes
Post by: Owdy on July 08, 2004, 11:54:58 AM
Quote from: romanov on July 08, 2004, 11:52:23 AM
Do you mean make a php file called phpinfo.php and add <?php phpinfo(); ?>
Yes, that is what ment. Put that file to your site.
Title: Re: settings.php is 0 bytes
Post by: Ride on September 25, 2005, 02:58:45 PM
Sorry to bring up an old topic but the same thing has happened to me a few times.  Everything gets screwed up and then I see that settings.php is 0 bytes.  Any idea what causes this?  Message me for a phpinfo link if you need it.  Thanks.
Title: Re: settings.php is 0 bytes
Post by: Ben_S on September 25, 2005, 03:29:51 PM
If the server was out of disk space and the file was being written to it, that would cause the issue.
Title: Re: settings.php is 0 bytes
Post by: Ride on September 25, 2005, 03:37:03 PM
Quote from: Ben_S on September 25, 2005, 03:29:51 PM
If the server was out of disk space and the file was being written to it, that would cause the issue.

I thought of that but isn't the settings file only written to if I were to change settings?  This happened both times while I was away so I know I wasn't doing anything.
Title: Re: settings.php is 0 bytes
Post by: Ben_S on September 25, 2005, 04:03:10 PM
If there is an error, smf writes the timestamp of the error to settings.php
Title: Re: settings.php is 0 bytes
Post by: forumite on September 25, 2005, 11:33:00 PM
I had the same problem, but never found out why (it wasn't a server capacity problem). I initially thought I'd been hacked, but subsequently realized that the php start and end tags <?php ....  ?> were intact and everything else in the file was missing. I can't imagine a hacker taking the trouble to selectively remove the content and leave the tags.

I was left scratching my head, but my host kindly came to my rescue, quickly figured out the problem, and activated the backup copy of the file.
Title: Re: settings.php is 0 bytes
Post by: Ride on September 26, 2005, 07:23:43 PM
Quote from: rvforumite on September 25, 2005, 11:33:00 PM
I had the same problem, but never found out why (it wasn't a server capacity problem). I initially thought I'd been hacked, but subsequently realized that the php start and end tags <?php ....  ?> were intact and everything else in the file was missing. I can't imagine a hacker taking the trouble to selectively remove the content and leave the tags.

I was left scratching my head, but my host kindly came to my rescue, quickly figured out the problem, and activated the backup copy of the file.

I was thinking hack to because it happened both times on a saturday night.  Unknown, what are your thoughts on this issue?
Title: Re: settings.php is 0 bytes
Post by: forumite on September 26, 2005, 10:57:54 PM
Here's (http://www.simplemachines.org/community/index.php?topic=42152.msg305730#msg305730) Unknown's prior suggestion for this problem.

FWIW I've seen reference here to others having the same problem with this file and nobody knowing why.
Title: Re: settings.php is 0 bytes
Post by: Ride on September 26, 2005, 11:57:44 PM
Quote from: rvforumite on September 26, 2005, 10:57:54 PM
Here's (http://www.simplemachines.org/community/index.php?topic=42152.msg305730#msg305730) Unknown's prior suggestion for this problem.

FWIW I've seen reference here to others having the same problem with this file and nobody knowing why.

I get  " The topic or board you are looking for appears to be either missing or off limits to you."  when trying to go to the link you posted.
Title: Re: settings.php is 0 bytes
Post by: forumite on September 27, 2005, 12:49:49 AM
Must be in the Charter Members area. Sorry. All it said was to protect the file by changing the permissions to make it non-writable. This presumably prevents accidental writing to the file & erasure of all or part of the contents, but I don't think it addresses the route cause of why the file is getting modified the way mine was.

BTW did you look at the contents of your file to see if contained something e.g. the php tags? I'm just curious.
Title: Re: settings.php is 0 bytes
Post by: Ride on September 27, 2005, 05:46:24 PM
Quote from: rvforumite on September 27, 2005, 12:49:49 AM
Must be in the Charter Members area. Sorry. All it said was to protect the file by changing the permissions to make it non-writable. This presumably prevents accidental writing to the file & erasure of all or part of the contents, but I don't think it addresses the route cause of why the file is getting modified the way mine was.

BTW did you look at the contents of your file to see if contained something e.g. the php tags? I'm just curious.

I changed the permissions to non-writable actually and it still happened.  It's possible the permissions got changed before then though, I'm not sure.  I didn't have anything inside mine, totally blank.
Title: Re: settings.php is 0 bytes
Post by: forumite on September 27, 2005, 06:02:11 PM
OK thanks Ride. Mine hasn't done it since I changed the permissions, but it's a PITA to change permissions back in order to do something as simple as putting the forum in maintenance mode. Sounds like what's remaining in the file is unpredictable. In any event, it breaks functionality of the forum, so hopefully someone will come up with a reason why this happens.