tags:

views:

96

answers:

3

Hello.

I have this error appearing:

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

Which I think is a PHP error. However, the site in question is an out of the box iweb design with no PHP in it.

I have no idea what could be doing it.

+6  A: 

Could be that the server is misconfigured to treat .html files as if they can contain PHP code. Might want to check what extensions the server is configured to use for PHP.

Eric Petroelje
Shouldn't it interpret just the `<?php ?>` tags?
Alex Ciminian
@Alex Ciminian: This could be an XHTML file with xml header and short tags enabled for PHP.
Residuum
@Residuum - my thoughts exactly.
Eric Petroelje
+1  A: 

The extension of a file on a webserver has very little to do with what actually happens in the background with that file. You could configure a webserver to serve up an "index.exe", have it parsed by PHP, and be output as HTML.

I don't know about about this 'iweb' business, but on Apache, you can trivially map any extension to be parsed by PHP with a single directive:

AddHandler php5-script .html
Marc B
+5  A: 

Your server should be configured to treat html file as php. The reason it is throwing a parse error should be because you use XHTML for your page, with an XML declaration which begins with <?xml

If short_open_tags is set to on, it could start interpreting PHP code with 'xml ....' on the first line.

You can both disable php handler by removing a similar line in your apache conf.

AddHandler php5-script .html

or you can disable short_open_tags in your php.ini, vhost, htaccess by setting a php_flag

Boris Guéry
ok, assuming that is true on my server, how do I set it to off?
YsoL8