这是我的项目的文件夹结构:
/平 - /控制器 ----Ping_Connroller_Main.php ----Ping_Connroller_Db.php - /模型 ----dbCredentials.php - /看法 ----输出.html.php
“ping”是包含我的项目的文件夹,它位于我计算机上的“xampp/htdocs/”目录中(C:/xampplite/htdocs/)
以下是每个文件的初始代码:
OUTPUT.HTML.PHP
---------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include($root.'/ping/Controller/Ping_Controller_Main.php');
PING_CONTROLLER_DB.PHP
----------------------
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
require($root.'/ping/Model/dbCredentials.php');
class Ping_Controller_Db
{
PING_CONTROLLER_MAIN.PHP
------------------------
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
require($root.'/ping/Controller/Ping_Controller_Db.php');
class Ping_Controller_Main
{
这些是我尝试在浏览器中访问“output.html.php”文件时遇到的错误:
Warning: include(C:/xampplite/htdocs/ping/Controller/Ping_Controller_Main.php) [function.include]: failed to open stream: No such file or directory in C:\xampplite\htdocs\ping\View\output.html.php on line 6
Warning: include() [function.include]: Failed opening 'C:/xampplite/htdocs/ping/Controller/Ping_Controller_Main.php' for inclusion (include_path='.;C:\xampplite\php\PEAR') in C:\xampplite\htdocs\ping\View\output.html.php on line 6
我知道我一定是在做一些非常愚蠢的事情,但在过去的 20 分钟里我一直盯着这个错误,似乎无法让它发挥作用。
提前致谢!