首页 > 解决方案 > 警告:require_once 和致命错误:require_once():托管网站时

问题描述

我在 000webhosting 中上传我的代码以发布网站,但它显示错误。但是本地主机没有错误。我希望你们能帮助我,因为我是网络开发的新手。

错误:

警告:require_once(/storage/ssd1/726/17342726/public_html//RECYCLE AND REWARDING/include/config.php):无法打开流:/storage/ssd1/726/17342726/public_html/include 中没有这样的文件或目录/initialize.php 在第 15 行

致命错误:require_once(): 无法打开所需的 '/storage/ssd1/726/17342726/public_html//RECYCLE AND REWARDING/include/config.php' (include_path='.:/usr/share/pear:/usr/share /php') 在第 15 行的 /storage/ssd1/726/17342726/public_html/include/initialize.php 中

链接:https ://recycle-and-rewarding-app.000webhostapp.com/

下面是我在 initialize.php 上的代码

<?php
//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.DS.'RECYCLE AND REWARDING');

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

//load the database configuration first.
require_once(LIB_PATH.DS."config.php");
require_once(LIB_PATH.DS."function.php");
require_once(LIB_PATH.DS."session.php");
require_once(LIB_PATH.DS."accounts.php");
require_once(LIB_PATH.DS."autonumbers.php");  
require_once(LIB_PATH.DS."companies.php");  
require_once(LIB_PATH.DS."job.php");  
require_once(LIB_PATH.DS."employees.php");  
require_once(LIB_PATH.DS."categories.php");  
require_once(LIB_PATH.DS."applicant.php");  
require_once(LIB_PATH.DS."jobregistration.php");  
  
require_once(LIB_PATH.DS."database.php");
?>

标签: phphostingweb-hosting

解决方案


推荐阅读