unexpected T_STRING error

unexpected T_STRING error

When you use a client like iWeb to develop your site you might run into an issue with “unexpected T_STRING” when you upload to your site.The reason for the error is your iWeb produce a web pages with a short tag in your file that has something like below:

The first line says: < ?xml version=”1.0″ encoding=”UTF-8″? >

With the <? it will be interpreted as PHP pages and the web server will try to parse it but more than likely the server is set with short tag to off thus will create an error like “Parse error: syntax error, unexpected T_STRING” on all your pages.

One option would be to manually edit each of your pages to remove the first line to avoid the error but that would be lot of work.

A better option would be to turn off short tag by adding one line in your .htaccess like below:

php_value short_open_tag off

This will save you lot of time!