PHP Parse error: syntax error, unexpected T_STRING in /whatever/my-php-class.php.html on line 1 with PhpDocumentor files on CentOS

Symptom:

  • 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’

Fix:

Add the following to an .htaccess file in the folder (or a parent folder):

php_value short_open_tag off

I don’t know if this is a ‘bug’ or a ‘feature’. I don’t see why Apache should be interpreting *.php.html [...]

Continue reading ‘PHP Parse error: syntax error, unexpected T_STRING in /whatever/my-php-class.php.html on line 1 with PhpDocumentor files on CentOS’ »

Leave a Reply