Website showing PHP source
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 fi开发者_运维百科le. 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/>"; ?>
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.
精彩评论