Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: shepdawg on November 24, 2008, 02:50:48 PM

Title: parse error in settings.php
Post by: shepdawg on November 24, 2008, 02:50:48 PM
Hello, I have had my forums running for about 6 months now with no problems, but today my users get this message when they try to get to the forums:
Parse error: parse error, unexpected T_STRING in /home/mrshep5/public_html/sas/forum/Settings.php on line 29

I have not edited the settings.php file, but I did try renaming the settings_bak.php file to settings.php and overwriting it. That did not work.

I have attached the settings.php file.
What do I need to do to fix this problem?
Title: Re: parse error in settings.php
Post by: Antechinus on November 24, 2008, 03:13:59 PM
Oh dear. No, that would not work. Ok, which file have you attached?

Is it the original one which was giving the error or is it the one that should still be called Settings_bak.php?

Do you have a backup copy of Settings_bak.php? You're going to need one.
Title: Re: parse error in settings.php
Post by: shepdawg on November 24, 2008, 03:27:36 PM
The settings_bak and settings file look exactly the same.
Title: Re: parse error in settings.php
Post by: Antechinus on November 24, 2008, 03:34:49 PM
Sorry, you're right in this case. Coffee time. Anyway the parse error is caused by the apostrophes in the text on that line. With php you have to do them like this:     we\'re

This is because a plain apostrophe is used all over the place as part of php coding. I've fixed it. 
Title: Re: parse error in settings.php
Post by: swtdivalove on November 24, 2008, 04:13:56 PM
Just as an added reminder... If you're statement begins with an apostrophe, it must also end in an apostrophe, just like with quotation marks.

Example:
<?php

$string1 
'Hello World!';
$string2 "Hello World!";

?>


Both will work. :)

But this will also work:

<?php

$string3 
'some string\'s go here!';

?>


And, last but not least...


<?php

$strings4 
"some string's go here!";

?>


Hope this helps! :)
Title: Re: parse error in settings.php
Post by: shepdawg on November 24, 2008, 04:22:35 PM
antechinus, thank you so much for fixing the file for me.
Thank swt for explaining the "
Title: Re: parse error in settings.php
Post by: swtdivalove on November 24, 2008, 04:41:49 PM
You betcha! :)