1
btesec
unexpected T_VARIABLE error
  • 2010/8/30 21:33

  • btesec

  • Friend of XOOPS

  • Posts: 623

  • Since: 2007/2/20


Hello,

I get an error as follows:
Parse error: syntax error, unexpected T_VARIABLE in /home/....../public_html/class/textsanitizer/config.custom.php on line 1


error log says:
PHP Parse error: syntax error, unexpected T_VARIABLE in /home/......../public_html/class/textsanitizer/config.custom.php on line 1

using:

MySQL version 5.1.48
Apache version 2.2.15
PHP version 5.2.14

Any help is welcome.

btesec

2
ghia
Re: unexpected T_VARIABLE error
  • 2010/8/31 6:31

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


XOOPS version?
Did you install or modify something recently?

Is the file config.custom.php original or did you edit it?
As it is in line 1, probably it has been saved in a wrong format, eg UTF-8 with BOM (should be without BOM) or a MAC format.

3
Mazarin
Re: unexpected T_VARIABLE error
  • 2010/8/31 6:42

  • Mazarin

  • Just can't stay away

  • Posts: 533

  • Since: 2008/12/10


Very common error when you've been a bit sloppy with the quotation marks in the code

4
btesec
Re: unexpected T_VARIABLE error
  • 2010/8/31 16:52

  • btesec

  • Friend of XOOPS

  • Posts: 623

  • Since: 2007/2/20


OK Guys,

I did a re-upload in binary mode and issue resolved. Thanks so much for the tips.

5
Peekay
Re: unexpected T_VARIABLE error
  • 2010/8/31 17:41

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Glad it worked, but I would advise you to always upload PHP files in ascii (text) mode. That way any foreign text formatting, e.g. older Mac OS line-breaks, will automatically be converted to the server OS format.

Many servers don't care, but I have come across some that are really picky about this.

On a related point, I have discovered that some versions of the Smarty compiler will choke on accented characters (e.g. French) if they are present in HTML comments in templates. This returns a rather misleading 'unclosed tag' error.
A thread is for life. Not just for Christmas.

6
ghia
Re: unexpected T_VARIABLE error
  • 2010/8/31 18:12

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
On a related point, I have discovered that some versions of the Smarty compiler will choke on accented characters (e.g. French) if they are present in HTML comments in templates. This returns a rather misleading 'unclosed tag' error.
I believe that this occurs when the files are not in the same format as the website (UTF-8 w/o BOM - UTF-8 and ansi - ISOxxxxx).

7
btesec
Re: unexpected T_VARIABLE error
  • 2010/8/31 18:50

  • btesec

  • Friend of XOOPS

  • Posts: 623

  • Since: 2007/2/20


thanks guys

8
deepak267
Re: unexpected T_VARIABLE error
  • 2010/8/31 18:52

  • deepak267

  • Quite a regular

  • Posts: 352

  • Since: 2008/8/15


I had experienced once due to FTP was not successfull in one go. The connection broke and the module did not work properly. I had to remove all file and transfer them again to resolve it.

It may be just my internet connection, but incase you encounter such issue, just start from the begining.

Deepak
A member of www.AquariumHomeCare.com

Login

Who's Online

272 user(s) are online (156 user(s) are browsing Support Forums)


Members: 0


Guests: 272


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits