Re: php4 choking on xhtml
> I'm running woody with apache, php4 and php4-domxml installed.
> Everything is working as advertised except for one thing that has me
> baffled. The xml declaration(<?xml version="1.0" encoding="UTF-8"?>) at
> the top of all my well-formed strict xhtml 1.0 documents is causing a
> parse error from PHP. Said pages work fine without the xml declaration
> but then they are no longer well-formed.
I suspect the problem is in /etc/php4/apache/php.ini:
short_open_tag = On
You probably want this to be 'Off' because with it 'On' php is
trying to figure out what the 'xml version="1.0" encoding="UTF-8"'
means, since php is reading your XML tag as a PHP tag. With the
'short_open_tag' set to 'Off', all your php code blocks will need to
start with '<?php' instead of '<?'
Don't forget to restart apache after changing the php settings.
Chris
--
Christopher S. Swingley phone: 907-474-2689
IS Professional, Level 4 email: cswingle@iarc.uaf.edu
IARC -- Frontier Program GPG and PGP keys at my web page:
University of Alaska Fairbanks www.frontier.iarc.uaf.edu/~cswingle
Reply to: