#24825 [WFx]: ?xml tag mistaken for ?php

2003-07-27 Thread drbezborodow at webpathways dot com
 ID:   24825
 User updated by:  drbezborodow at webpathways dot com
 Reported By:  drbezborodow at webpathways dot com
 Status:   Wont fix
 Bug Type: Feature/Change Request
 Operating System: UNIX
 PHP Version:  4.3.2
 New Comment:

Thank you very much for your response. I posted my bug report at
phpbuilder.com and they basically laughed at me. I had to explain that
I am a new user of PHP and havn't been around to see previous
versions.

Where may I find more specific information about this php_flag
short_open_tags off, that you mentioned?

- Damien Bezborodow


Previous Comments:


[2003-07-27 00:51:33] [EMAIL PROTECTED]

I completely sympathize with what you're saying, however this is a
behavior which is not (directly) going to change.  Allow me to explain
why.

What's catching the '?xml' tag is actually the scan for the
short_open_tag version of '?'.   When this type of open tag was first
created, you're absolutely right, not enough attention was paid to the
world outside of PHP.  

In the designers defense, XML was a much smaller blip on the radar at
the time, and creating XML documents from PHP sources was not a
priority.

It is precisely because of this ambiguity that the long open tag was
devised.  However, in the interest of maintaining compatability with
preexisting scripts, the short open tag was neither removed, nor was it
modified to require a space between it and instruction code.

If your hosting provider allows you to modify php.ini options I'd
recommend turning short_open_tags off.  With apache this can even be
done on a per-virtualserver/per-directory basis using:

php_flag short_open_tags off

If not, I'm afraid your only option until (if?) the short open tag is
fully disabled (don't hold your breath) is to use the echo ?xml;
hack you mentioned.

Sorry I couldn't give you a better response, and thank you for using
PHP.



[2003-07-27 00:07:46] drbezborodow at webpathways dot com

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 this bug report at http://bugs.php.net/?id=24825edit=1



#24825 [NEW]: ?xml tag mistaken for ?php

2003-07-26 Thread drbezborodow at webpathways dot com
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=24825edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24825r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24825r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=24825r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=24825r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24825r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=24825r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=24825r=support
Expected behavior:  http://bugs.php.net/fix.php?id=24825r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=24825r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=24825r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=24825r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24825r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=24825r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=24825r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=24825r=gnused