View Full Version : Parse Error in XHTML Doctype

04-02-2003, 06:02 PM

I'm running into a weird problem. I installed phpDev with Apache on my computer (Windows XP) and my pages on localhost display fine without a doctype but when I try and put in an XHTML compliant page I get the following error:

Parse error: parse error in c:\phpdev\www\public\castle\index.htm on line 1

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>Baie Ste. Anne Building Supplies</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<link rel="stylesheet" type="text/css" href="css/babsStyle.css">

<script type="text/javascript" src="js/babs.js">



- Terry

04-02-2003, 06:51 PM
turn short_tags off in your ini :)

<? <--- is read as <?php by the parser

04-02-2003, 11:38 PM
The PHP engine shouldn't be parsing that file anyways if it has a .htm extension unless you set your configuration to parse all .htm or .html files as .php.

04-03-2003, 03:14 AM
The parser is getting confused by the question marks in
<?xml version="1.0" encoding="iso-8859-1"?>


Is the PHP engine thinking that I'm dropping into php script...

This particular file is a straight xhtml file but I was getting an error on my localhost... phpdev. That's why I posted this in PHP.

I was posting from my work. At home I'm working on IIS with php installed as a dll module and I've never had a problem with xhtml doctypes on localhost. Why is the Apache server is different? What does short_tags do? I can't find that variable in my ini file.


04-03-2003, 12:10 PM
Maybe you have different php.ini files for your php setups? Anyway, the configuration option is called short_open_tag, and here's also something in the manual about it: http://www.php.net/manual/en/configuration.directives.php (the first config option it is).

04-03-2003, 01:29 PM
Thanks, that's what I was looking for. I think I'll just php echo out the xml version. I should use the manuals more often :p