I recently built XHP 1.5 from source, and installed it on an existing web server. The web server is running PHP 5.4.32, Apache 2.2.15 calling PHP using mod_php (not fastcgi), CentOS 6.5. All our existing PHP code (that doesn't rely on the new XHP syntax) still works great, including other extensions like Imagick, curl, and JSON.
Using a test file based on the XHP installation test:
<?php
echo "XHP!\n";
exit;
echo <a/>;
?>
This works as expected when run from the command line. (It prints XHP! then exits. The doesn't cause the parser to fail, but doesn't display either, since we're not loading in the dependencies.)
When I fetch this script through Apache, I get the error
Parse error: syntax error, unexpected '<' in /var/www/html/bloom/play.php on line 4
Getting phpinfo() via Apache shows that XHP is loaded, extension_loaded("xhp") through Apache returns true.
What could be causing XHP to work from the command line, but to not work (not even parse) when run via Apache?