3

I have a server running on SunOS 5.1, and I'm having an issue with the source of a php file displaying. The source starts displaying after => when setting up an array. After the first => it displays the rest of the file. Why would this be happening?

Example source: index.php

<?php

$tmpVar = 'just testing';
$tmpArray = array(
    'test1' => 'rawr1',
    'test2' => 'rawr2',
    'test3' => 'rawr3'
);

echo "Testing<br/>";    

?>

This would output:

'rawr1', 'test2' => 'rawr2', 'test3' => 'rawr3'); echo "Testing<br/>"; ?>
Nathan
  • 2,699
  • 5
  • 30
  • 44

1 Answers1

8

The whole source is displaying, it's just interpreting the part before the > as an HTML tag so you don't see it. View source from your browser and you'll see that your file wasn't parsed at all. That's the problem, you haven't correctly configured your web server to parse PHP at all.

Dan Grossman
  • 51,866
  • 10
  • 112
  • 101
  • It parses everything else fine, until it hits an array using =>. The rest of the page is displaying perfectly. – Nathan Jan 28 '11 at 12:13
  • 1
    @Atrox What happens if you view the page source in your web browser? If Dan is right, you'll just see your entire php file, which isn't being interpreted as PHP at all, but as HTML. – Matt Gibson Jan 28 '11 at 12:16
  • 1
    @Atrox that means you are missing a tag its interpreting the > part of => as the end of a html tag. check your opening and closing tags – DeveloperChris Jan 28 '11 at 12:16
  • I've checked them all. On a page with no array definitions it works fine. This code is a mirror of a directory on another server, where it works flawlessly. – Nathan Jan 28 '11 at 12:20