|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-01 22:21 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 21:00:01 2025 UTC |
Description: ------------ Using apache 2.0, I added a content handler for XML files so they get processed by a PHP script. I want to include XML files into an output buffer but I get an "Unexpected T_STRING" parse error from the "<?xml version="1.0"?> processing instruction. This is because PHP is, incorrectly, parsing all processing instructions as PHP code. httpd.conf: ... AcceptPathInfo On ... .htaccess: ... Action process ./process.php AddHandler process .xml ... Reproduce code: --------------- process.php: <?php ob_start(); include($_SERVER("PATH_TRANSLATED")); ob_end_flush(); ?> content.xml: <?xml version="1.0"?> <tag>some data</tag> Expected result: ---------------- I expect to see the following in "view source" in my browser: <?xml version="1.0"?> <tag>some data</tag> Actual result: -------------- PHP incorrectly attempts to parse the XML declaration at the beginning of content.xml giving an "Unexpected T_STRING, line 1, content.xml" error.