PHP 包括不显示


PHP include not showing up

我有一个php包含,其中一条路径指向[root]/Edge-animations/splash/publish/web/splash.php,我的服务器上有一个有效的路径。在我第一次尝试时,我收到一个错误,指出路径无效;事实证明,我需要放置完整的服务器路径(沿着/homepages/3/d426847376/htdocs/Edge-animations/splash/publish/web/splash.php行)。更正链接后,我尝试重新加载我的页面;它没有显示错误,但也没有显示它应该包含的文件。我的PHP语法如下:

<?php include('/homepages/3/d426847376/htdocs/Edge-animations/splash/publish/web/splash.php'); ?>

并与我在另一个页面上用于工作 PHP 的语法相匹配。我做错了什么?



编辑
包含的文件是 Edge 输出的 HTML 文件;我将扩展名从 .html 更改为 .php。这是它的代码:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled</title>
<!--Adobe Edge Runtime-->
<meta http-equiv="X-UA-Compatible" content="chrome=IE8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-          frame/1/CFInstall.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="splash-v1_edgePreload.js">    </script>
    <style>
    .edgeLoad-Splash { display:none; }
</style>
<!--Adobe Edge Runtime End-->
</head>
<body style="margin:0;padding:0;">
<div id="Stage" class="Splash">
</div>
</body>
</html>

我现在还在链接中添加了括号和分号;它仍然不起作用。

仅用于测试目的

<?php
$path = '/homepages/3/..........';
ini_set('display_errors', true);
error_reporting(E_ALL);
echo 'path=',$path, "<br />'n";
if ( !file_exists($path) ) {
    die('no such file');
}
else {
    //include $path;
    echo '<p>opening file</p>';
    $fp = fopen($path, 'rb');
    if ( !$fp ) {
        die('open failed');
    }
    echo '<p>reading file</p>';
    $content = stream_get_contents($fp);
    if ( false===$content ) {
        die('read failed');
    }
    echo '<p>strlen(content)=',strlen($content), '<p>';
}