[Help] Parse error: syntax error, unexpected '}' Settings.php on line 51

Started by nicksahil, June 06, 2012, 08:20:50 AM

Previous topic - Next topic

nicksahil

hello everyone, i searched whole forum and found lots of solution but none of them solved my problem :(

my url: xxxxxxxxx

when i am opening it, its showing Parse error: syntax error, unexpected '}' in /home/xxxx/public_html/forum/Settings.php on line 51

Hep needed, Please ;(

ps: i tried everything like repair_settings.php & smf full upgrade etc

nicksahil

Here is my ending line of settings.php

# Make sure the paths are correct... at least try to fix them.
if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt'))
$boarddir = dirname(__FILE__);
if (!file_exists($sourcedir) && file_exists($boarddir . '/Sources'))
$sourcedir = $boarddir . '/Sources';
if (!file_exists($cachedir) && file_exists($boarddir . '/cache'))
$cachedir = $boarddir . '/cache';

?>

kat

As the message says that the error's in line fifty-one and you seem to have posted everything from line fifty-four onwards... (At least, that's what it looks like, looking at my copy of that file)

Can you try, again? ;)

MrPhil

Starting at line 45, it should look like this:
########## Error-Catching ##########
# Note: You shouldn't touch these settings.
$db_last_error = 0;

if (file_exists(dirname(__FILE__) . '/install.php'))
{
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;
}


There is one { and one } in the file. Check to see if the first one was obliterated, or an additional } added, by something (a hack?).

nicksahil

Problem is now solved.  I will say never use smf simple ads on smf 2.0.2

I deleted all files from my server except attachment. And then i installed fresh smf forum on server with new db and completed the installation. After that restored the old database. Now everything is working fine :)

Thanks for all replies!

Advertisement: