I am trying to implement PHP code onto a html page, something I've done before without any problems. Now, however, the PHP flag closes prematurely and so PHP code is printed to the page instead of run. My page is similar to this:
<html>
<body>
<h1>Test</h1>
<?php
$array = array(
"foo" => "bar",
"bar" => "foo",
);
echo($array["foo"]);
?>
</body>
I would expect the page to then return;
Test
bar
However, the PHP stops at the first instance of '>' so leaves;
Test
"bar","bar"=>"foo",);echo($array["foo"]);?>
Is this a problem with the apache configuration? How can I fix it?