PHP Parse error: syntax error, unexpected T_STRING in /whatever/my-php-class.php.html on line 1 with PhpDocumentor files on CentOS
- An XML file saved as something.php.html
- Apache was trying to parse it as PHP and throwing an error because Short_open_tag was ‘on’
Add the following to an .htaccess file in the folder (or a parent folder):
I don’t know if this is a ‘bug’ or a ‘feature’. I don’t see why Apache should be interpreting *.php.html files as PHP (BAD Apache) but now that the issue is fixed for me I am not too concerned.
Kae Varens already came across this and blogged about it in October 2008. It turns out that
- it’s Apache – not me!
- there is a lot more to this than meets the eye