#24825 [NEW]: <?xml tag mistaken for <?php
From: drbezborodow at webpathways dot com
Operating system: UNIX
PHP version: 4.3.2
PHP Bug Type: Feature/Change Request
Bug description: <?xml tag mistaken for <?php
Description:
------------
I am not totally sure which version of PHP my web server is using, but I
am positive that it is PHP4+. The web host's website is:
www.echoechoplus.com
Getting to the point, the PHP server mistakes this tag:
<?xml version="1.0" encoding="iso-8859-1"?>
for the opening and closing of <?php and ?>
The truth is that the designers overlooked (as is understandable in such a
huge project) the fact that there are other technologies out there other
than PHP.
The server belives that <?xml is really <?php so it says, "sorry, you have
made an error. We can't show you this page."
The fact is: if I said, "I wan't apples", the server shouldn't say,
"sorry, you spelt oranges incorrectly, please try again"! ;)
A temporary workaround for this problem is VERY simple:
<?php print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"
?>
Reproduce code:
---------------
Create a file named whatever you like with the php extension (ie
whatever.php).
In this document, put these XHTML tags in line one, save it and then run
the page on a PHP server:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">
Expected result:
----------------
The tag would have been as normal:
<?xml version="1.0" encoding="iso-8859-1"?>
The PHP Engine should have had nothing to do with this tag. It is an XML
tag, but the server thought it was the beginning and end of a PHP script.
IE: <?php /*content*/ ?>
Actual result:
--------------
Parse error: parse error in /home/hbsast/harriscoaches.com.au/index.php on
line 1
--
Edit bug report at http://bugs.php.net/?id=24825&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24825&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24825&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=24825&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24825&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24825&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24825&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24825&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24825&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24825&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24825&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24825&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24825&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24825&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24825&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24825&r=gnused
Thread (4 messages)
- drbezborodow at webpathways dot com