In Windows (WAMP) I have an index.php like this
<?xml version="1.0" encoding="utf-8"?>
<?php
// ...
?>
and it works as expected.
Now I’ve just configured a LAMP on Ubuntu and the same file (when invoked from a browser) gives me an error. Looking in error.log I’ve found
PHP Parse error: syntax error, unexpected T_STRING in
/var/www/test/index.php on line 1
If I remove first line everything works fine.
What’s wrong? Why this works on Windows and not on Linux?
Could this be caused from a particular extension?
It sounds like you have short tags enabled, which will cause PHP to try and parse what comes after
<?.Set the config option
short_open_tagin php.ini to0orOffand restart Apache.