This site provides the following access keys:

Brandan Lennox's

PHP and the XML Prolog

After my tremendous successes yesterday, I decided that I should technically have an XML prolog before the doctype on all my pages. So I dropped it into header.php and voila!

Parse error: syntax error, unexpected T_STRING in [...]/header.php on line 1

The PHP interpreter was trying to parse the prolog.

Actually, it was working on my local machine running PHP 5.2.2, but LunarPages is running PHP 5.2.5. My first thought was a regression in PHP (clearly it wasn’t my fault), but Google didn’t turn up anything interesting, so I opened a ticket with LunarPages’ support (which astoundingly required me to creating a separate account for support — and then asked me for my domain). They pointed out that I apparently had short_open_tag turned on in my PHP config. Once that was disabled, everything was peachy.

Five years of writing PHP and I still get bitten in the ass on a pretty regular basis.