简体   繁体   中英

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 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/>"; ?>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM