Webhosting Blog

Parse error: syntax error, unexpected T_STRING


At times the site displays following error:

Parse error: syntax error, unexpected T_STRING in /home/test/public_html/index.html on line 1

This error is generally encountered because of the setting short_open_tag in php.ini.
short_open_tag  :: Allow the <? tag.  Otherwise, only <?php and <script> tags are recognized.

Follow following steps to remove the error:
1) Go to the document root of the domain.

[server@root~]# cd /home/test/public_html

2)Check if .htaccess is available under the directory.

3)Insert following line in the .htaccess file

php_value short_open_tag off

4) Also you can set the php.ini in order to turn off the short_open_tag.

5)Open the file and locate the line ” short_open_tag = On”

6)Edit the line to read “short_open_tag = Off”. Save the file and reload the site.

7) The error will now be resolved.

Advertisements

3 responses

  1. Jane Trider

    It was very interesting for me to read that blog. Thank you for it. I like such topics and everything connected to this matter. I would like to read a bit more on that site soon. BTW, rather good design this blog has, but how about changing it once in a few months?

    Jane Trider
    escort agencies in london

    October 26, 2010 at 2:12 pm

  2. Pingback: Parse error: syntax error, unexpected T_STRING « vishnulinux

  3. I don’t even understand how I stopped up right here,
    but I believed this publish was good. I don’t recognize who you are but definitely you’re going to a famous blogger in case you aren’t already.
    Cheers!

    May 25, 2015 at 2:15 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s