繁体   English   中英

致命错误:require_once():需要打开失败

[英]Fatal error: require_once(): Failed opening required

我需要有关此错误的帮助请将此脚本安装在我的 easyphp 上有什么问题吗?

Warning: require_once(C:/Program Files (x86)/EasyPHP-DevServer-14.1VC9/data/localweb\studentTrans\includes\config.php): failed to open stream: No such file or directory in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\StudentTranscript Processing System in PHP with MySQL\includes\initialize.php on line 21

您好,我需要有关此错误的帮助,请将此脚本安装在我的 easyphp 上有什么问题吗?

Fatal error: require_once(): Failed opening required 'C:/Program Files (x86)/EasyPHP-DevServer-14.1VC9/data/localweb\studentTrans\includes\config.php' (include_path='.;C:\php\pear') in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\StudentTranscript Processing System in PHP with MySQL\includes\initialize.php on line 21



 //define the core paths
 /Define them as absolute peths to make sure that require_once works as 
 expected

 //DIRECTORY_SEPARATOR is a PHP Pre-defined constants:
 //(\ for windows, / for Unix)
 defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);

 defined('SITE_ROOT') ? null : define ('SITE_ROOT', 
 $_SERVER['DOCUMENT_ROOT'].DS.'studentTrans');

 defined('LIB_PATH') ? null : define ('LIB_PATH',SITE_ROOT.DS.'includes');

 // load config file first 
   require_once "config.php";
//load basic functions next so that everything after can use them
  require_once "functions.php";
  //later here where we are going to put our class session
  require_once "session.php";
  require_once "member.php";
  require_once "student.php";
  require_once "student_details.php";
  require_once "student_requirements.php";
  require_once "department.php";
  require_once "sy.php";
  require_once "instructor.php";
  require_once "instructorclasses.php";
  require_once "studSubjects.php";
  require_once "grades.php";
  require_once "room.php";

//Load Core objects
require_once"database.php";

//load database-related classes

我不知道您要包含的文件与您执行的文件的相对位置。

但是,您可以仅使用DIR获取路径,然后在其中导航。

例如,

$this_directory = __DIR__;
$file_to_include = $this_directory."\includes\config.php";
require_once $file_to_include;

希望这可以帮助

你在包含的文件“initialize.php”中有问题..

问题解决了它在这里?:defined('SITE_ROOT'), null: define ('SITE_ROOT'. $_SERVER['C.\Program Files (x86)\EasyPHP-DevServer- 14.1VC9\data\localweb'];DS .'studentTrans');

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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