Advertisement:
NameCheap

Author Topic: Parse error: syntax error, unexpected T_STRING  (Read 14090 times)

Offline AZVQ

  • Newbie
  • *
  • Posts: 6
Parse error: syntax error, unexpected T_STRING
« on: October 14, 2007, 06:31:37 PM »
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)
Code: [Select]
########## 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.

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,802
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Parse error: syntax error, unexpected T_STRING
« Reply #1 on: October 14, 2007, 07:10:04 PM »
Did you manually edit your settings.php file?  Change this line:
Code: [Select]
$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 ]

Offline AZVQ

  • Newbie
  • *
  • Posts: 6
Re: Parse error: syntax error, unexpected T_STRING
« Reply #2 on: October 14, 2007, 07:19:11 PM »
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.
Code: [Select]
// 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);
}

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,802
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Parse error: syntax error, unexpected T_STRING
« Reply #3 on: October 14, 2007, 08:33:24 PM »
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 ]

Offline Herman's Mixen

  • SMF Hero
  • ******
  • Posts: 7,120
  • Gender: Male
    • hermans.mixen on Facebook
    • TheBurglar on GitHub
    • Herman's Mixen
Re: Parse error: syntax error, unexpected T_STRING
« Reply #4 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!!
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 ;)

Offline AZVQ

  • Newbie
  • *
  • Posts: 6
Re: Parse error: syntax error, unexpected T_STRING
« Reply #5 on: October 15, 2007, 12:20:16 AM »
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.

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,802
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Parse error: syntax error, unexpected T_STRING
« Reply #6 on: October 15, 2007, 01:06:03 AM »
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 ]

Offline CyberChimp

  • Newbie
  • *
  • Posts: 8
Re: Parse error: syntax error, unexpected T_STRING
« Reply #7 on: October 15, 2007, 03:20:04 AM »
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.

Offline Herman's Mixen

  • SMF Hero
  • ******
  • Posts: 7,120
  • Gender: Male
    • hermans.mixen on Facebook
    • TheBurglar on GitHub
    • Herman's Mixen
Re: Parse error: syntax error, unexpected T_STRING
« Reply #8 on: October 15, 2007, 03:34:06 AM »
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 ;)

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: Parse error: syntax error, unexpected T_STRING
« Reply #9 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.

Offline AZVQ

  • Newbie
  • *
  • Posts: 6
Re: Parse error: syntax error, unexpected T_STRING
« Reply #10 on: October 15, 2007, 10:52:16 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.

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: Parse error: syntax error, unexpected T_STRING
« Reply #11 on: October 15, 2007, 11:45:10 PM »
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.

Offline AZVQ

  • Newbie
  • *
  • Posts: 6
Re: Parse error: syntax error, unexpected T_STRING
« Reply #12 on: October 16, 2007, 12:45:28 AM »
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!

Offline Herman's Mixen

  • SMF Hero
  • ******
  • Posts: 7,120
  • Gender: Male
    • hermans.mixen on Facebook
    • TheBurglar on GitHub
    • Herman's Mixen
Re: Parse error: syntax error, unexpected T_STRING
« Reply #13 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  ;)
« Last Edit: October 16, 2007, 05:41:10 AM by The Burglar! »
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 ;)

Offline AZVQ

  • Newbie
  • *
  • Posts: 6
Re: Parse error: syntax error, unexpected T_STRING
« Reply #14 on: October 17, 2007, 01:17:59 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....
hxxp:www.smartftp.com [nonactive]

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!

Offline Herman's Mixen

  • SMF Hero
  • ******
  • Posts: 7,120
  • Gender: Male
    • hermans.mixen on Facebook
    • TheBurglar on GitHub
    • Herman's Mixen
Re: Parse error: syntax error, unexpected T_STRING
« Reply #15 on: October 17, 2007, 04:19:14 AM »
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 ;)