web服务器运行在板子上,项目在实时Web服务器上运行但不在本地服务器上运行

我的项目正在网络服务器中运行,即Ecommerce Project

但它没有在我的本地服务器上运行并出现错误,即

Warning: require_once(Core.php): failed to open stream: No such file or directory in C:\xampp\htdocs\shop\inc\autoload.php on line 7

Fatal error: require_once(): Failed opening required 'Core.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\shop\inc\autoload.php on line 7

这是我的

的index.php

require_once('inc/autoload.php');

$core = new Core();

$core->run();

?>

core.php中

class Core {

public function run() {

ob_start();

require_once(Url::getPage());

ob_get_flush();

}

}

autoload.php

require_once('config.php');

function __autoload($class_name) {

$class = explode("_", $class_name);

$path = implode("/", $class).".php";

require_once($path);

}

config.php

if(!isset($_SESSION)) {

session_start();

}

// site domain name with http

defined("SITE_URL")

|| define("SITE_URL", "http://".$_SERVER['SERVER_NAME']);

// directory separator

defined("DS")

|| define("DS", DIRECTORY_SEPARATOR);

// root path

defined("ROOT_PATH")

|| define("ROOT_PATH", realpath(dirname(__FILE__) . DS."..".DS));

// classes folder

defined("CLASSES_DIR")

|| define("CLASSES_DIR", "classes");

// pages directory

defined("PAGES_DIR")

|| define("PAGES_DIR", "pages");

// modules folder

defined("MOD_DIR")

|| define("MOD_DIR", "mod");

// inc folder

defined("INC_DIR")

|| define("INC_DIR", "inc");

// templates folder

defined("TEMPLATE_DIR")

|| define("TEMPLATE_DIR", "template");

// emails path

defined("EMAILS_PATH")

|| define("EMAILS_PATH", ROOT_PATH.DS."emails");

// catalogue images path

defined("CATALOGUE_PATH")

|| define("CATALOGUE_PATH", ROOT_PATH.DS."media".DS."catalogue");

// add all above directories to the include path

set_include_path(implode(PATH_SEPARATOR, array(

realpath(ROOT_PATH.DS.CLASSES_DIR),

realpath(ROOT_PATH.DS.PAGES_DIR),

realpath(ROOT_PATH.DS.MOD_DIR),

realpath(ROOT_PATH.DS.INC_DIR),

realpath(ROOT_PATH.DS.TEMPLATE_DIR),

get_include_path()

)));

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值