显示 PHP 源代码的网站
我有一台在 SunOS 5.1 上运行的服务器,并且我在显示 php 文件的源时遇到问题。设置数组时,源在 => 之后开始显示。在第一个 => 之后,它显示文件的其余部分。为什么会发生这种情况呢?
示例来源: index.php
<?php
$tmpVar = 'just testing';
$tmpArray = array(
'test1' => 'rawr1',
'test2' => 'rawr2',
'test3' => 'rawr3'
);
echo "Testing<br/>";
?>
这将输出:
'rawr1', 'test2' => 'rawr2', 'test3' => 'rawr3'); echo "Testing<br/>"; ?>
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/>"; ?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
整个源代码正在显示,它只是将
>
之前的部分解释为 HTML 标记,因此您看不到它。从浏览器查看源代码,您会发现您的文件根本没有被解析。这就是问题所在,您根本没有正确配置 Web 服务器来解析 PHP。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.