News:

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

Main Menu

Parse error: syntax error, unexpected T_STRING

Started by AZVQ, October 14, 2007, 06:31:37 PM

Previous topic - Next topic

AZVQ

SMF Version: SMF 1.1.3
Im kind of stupid when it comes to codes and i tried changing it so many times but it still didnt solve the problem...I would really appreciate your help guys...

Here is the error message that I am getting.
"Parse error: syntax error, unexpected T_STRING in /home/azvq/public_html/forum/Settings.php on line 29"

Here is the code from the setting.php file. (starting from line 25 to 31)

########## Maintenance ##########
# Note: If $maintenance is set to 2, the forum will be unusable!  Change it to 0 to fix it.
$maintenance = '0'; # Set to 1 to enable Maintenance Mode, 2 to make the forum untouchable. (you'll have to make it 0 again manually!)
$mtitle = 'Upgrading the forum...'; # Title for the Maintenance Mode message.
$mmessage = 'Don't worry, we will be back shortly with an updated forum.'; # Description of why the forum is in maintenance mode.

########## Forum Info ##########


I would really appreciate your help, I know its probably a small error.

Rumbaar

Did you manually edit your settings.php file?  Change this line:
$mmessage = 'Don\'t worry, we will be back shortly with an updated forum.';
You need to "escape" special characters like ' in php.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

AZVQ

Thanks...No i didnt manually edit my settings... This error just came out of no where today...But when i change the code with the \ i get another error message....

"Parse error: syntax error, unexpected $end in /home/azvq/public_html/forum/Sources/Load.php on line 178" (Line 166 to line 176)...nothing on line 177 or 178. :(


Code from the load.php file.
// Do a few things to protect against missing settings or settings with invalid values...
if (empty($modSettings['defaultMaxTopics']) || $modSettings['defaultMaxTopics'] <= 0 || $modSettings['defaultMaxTopics'] > 999)
$modSettings['defaultMaxTopics'] = 20;
if (empty($modSettings['defaultMaxMessages']) || $modSettings['defaultMaxMessages'] <= 0 || $modSettings['defaultMaxMessages'] > 999)
$modSettings['defaultMaxMessages'] = 15;
if (empty($modSettings['defaultMaxMembers']) || $modSettings['defaultMaxMembers'] <= 0 || $modSettings['defaultMaxMembers'] > 999)
$modSettings['defaultMaxMembers'] = 30;

if (!empty($modSettings['cache_enable']))
cache_put_data('modSettings', $modSettings, 90);
}

Rumbaar

Did you manually changed the settings.php file or try to change it via the Server settings section?  What does that section look like now in settings.php?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Herman's Mixen

send me that file so i can debug it with an decent PHP editor like Zend Studio... wich will be display the errors... and those will be quickly fixed... with it!!
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

AZVQ

Quote from: The Burglar! on October 14, 2007, 08:40:15 PM
send me that file so i can debug it with an decent PHP editor like Zend Studio... wich will be display the errors... and those will be quickly fixed... with it!!

Thanks! I sent you an e-mail.

Rumbaar

I doubt you'll find an error with the post.php file, it will most likely be to do with the information it's extracting from the settings.php file.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

CyberChimp

I found my forum with the same error message today, viz:

Parse error: parse error, unexpected T_STRING in /usr/local/psa/home/vhosts/cyberchimp.co.uk/httpdocs/U75102/forum/Settings.php on line 28

Rumbaar's fix worked (thanks for that) but what's worrying is that I've never touched the Settings.php file.  In fact, I didn't access the forum at all on the day that Settings.php was changed (according to the file's date stamp, which I checked using my FTP program). 

Any idea how this could have happened?  Many thanks.

Herman's Mixen

Quote from: AZVQ on October 15, 2007, 12:20:16 AM
Quote from: The Burglar! on October 14, 2007, 08:40:15 PM
send me that file so i can debug it with an decent PHP editor like Zend Studio... wich will be display the errors... and those will be quickly fixed... with it!!

Thanks! I sent you an e-mail.

both files are not complete
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

greyknight17

I wonder if this can solve the issues. I know changing that line by adding the \ fixed the original problem, but try renaming your Settings_bak.php file to Settings.php (rename the original Settings.php to something else for now). See if you still get any errors.

AZVQ

Quote from: greyknight17 on October 15, 2007, 10:20:05 PM
I wonder if this can solve the issues. I know changing that line by adding the \ fixed the original problem, but try renaming your Settings_bak.php file to Settings.php (rename the original Settings.php to something else for now). See if you still get any errors.

I tried that and then it gave me the error that I ran into to start with.

greyknight17

The Burglar! said that both your files are not complete. Not 100% sure what's meant by that, but could be that your files are corrupted. Install a new forum to another folder. Run install.php again and use the same database information for your current live forum. Now copy over that Settings.php file to your live forum folder. Also try copying the Load.php file over (rename the current one for backup). See if you still have the errors now.

AZVQ

i also tried that...no dice! man this really sucks... is their a way for me to back up the board data so that I can reset it and upload the previous information? or any other ideas? I really appreciate your help by the way guys!

Herman's Mixen

#13
well both files were too short in line nummbers.... example load.php ended on line 178 normal load.php has much more lines 2220....
i have edited the settings file from a clean one with your details in it right here just upload it where it belongs.... load.php upload that one to /Sources/load.php

and try to use an other ftp client coz it seems that there where time outs when uploading....
www.smartftp.com

i have send you the new files by email !!

try if that works for ya  ;)
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

AZVQ

Quote from: The Burglar! on October 16, 2007, 05:37:40 AM
well both files were too short in line nummbers.... example load.php ended on line 178 normal load.php has much more lines 2220....
i have edited the settings file from a clean one with your details in it right here just upload it where it belongs.... load.php upload that one to /Sources/load.php

and try to use an other ftp client coz it seems that there where time outs when uploading....
www.smartftp.com

i have send you the new files by email !!

try if that works for ya  ;)

Hey thanks for all of your help! It must have been caused by my previous FTP CLient (ALFTP)... I had to re-load almost all of my source files and all that good stuff but Im back up and running...Id like to say thanks again to everyone who helped me with this!

Herman's Mixen

i am glad that it's working again... be welcome  ;D
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

Advertisement: