网页显示以下错误

时间:2015-05-12 13:44:48

标签: php netbeans-8

创建了一个名为Coffe website的文件夹。在xampp/htdocs中保存了此文件夹。将项目网址设为localhost/xampp/Coffewebsite。 Netbeans连接器在chrome中处于活动状态。它说web_page不可用。

错误讯息:

  

警告:include(Template.php):无法打开流:第5行的D:\ xampp setup \ htdocs \ Coffe website \ index.php中没有此类文件或目录

     

警告:include():无法打开' Template.php'在第5行的D:\ xampp setup \ htdocs \ Coffe website \ index.php中包含(include_path ='。; D:\ xampp setup \ php \ PEAR')。

的index.php:

<?php
$title="Home";
$content="Hello world";
include 'Templates.php' //to link this page to our templates 
?>

Templates.php:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title> <?php echo $title; ?> </title>
</head>
<body>
    <div id="wrapper">
        <div id="banner"></div>
        <nav id="navigation">
            <ul id="nav">
                <li><a href="index.php"> Home </a></li>
                <li><a href="#">Coffee</a></li>
                <li><a href="#">Shop</a></li>
                <li><a href="#">About</a></li>
            </ul>
        </nav>
        <div id="content area">
            <?php echo $content; ?>
        </div>
        <div id="sidebar"> </div>
        <footer> <p> All rights received </p> </footer>
    </body>
</html>

3 个答案:

答案 0 :(得分:0)

看起来Template.php不存在。

请务必仔细检查网址是否正确(例如,好的网址可能是directory/Template.phptemplate.php../Template.php)。

答案 1 :(得分:0)

请检查文件夹名称和文件名。如果你检查过它们,这些存在吗?在检查文件和路径名后,请告诉我们更多信息。

答案 2 :(得分:0)

“无法打开流:没有此类文件或目录”

这意味着您的脚本无法访问当前目录中的Template.php文件;)检查您的路径