Hosting Knowledge Base
“Parse error: syntax error, unexpected T_STRING” error appears on my website
The error “Parse error: syntax error, unexpected T_STRING” appears because your .html file starts with <? – which confuses our Apache web server into attempting to execute the code as it is a PHP script. To resolve the problem you will need to create a “.htaccess” file inside your website directory with the following content:
RemoveHandler .htm .html
This will remove the automatic parsing for .htm and .html files and your website should start working normally.
If you are using a paid hosting plan and you do not wish to use or create .htaccess files to fix the error, go to your Control Panel -> Hosting Tools -> Advanced Tools -> PHP Settings and click on the link at “Click HERE to edit your php.ini file.”. Then search for the php.ini directive “short_open_tag” and set it from “On” to “Off”, click on “Save” to apply the changes and have your site properly displaying.