【问题标题】:PHP/HTML: require_once(config.php): failed to open stream: No such file or directoryPHP/HTML:require_once(config.php):打开流失败:没有这样的文件或目录
【发布时间】:2019-12-12 13:17:15
【问题描述】:

这里只是简单的问题。

我将dashboard.php 放在文件夹中

pages/dashboard/dashboard.php.

但错误的出现就像我的问题一样。我能知道如何解决这个问题吗?

【问题讨论】:

  • 有没有包含 require_once("config.php");
  • 您是否同时检查了绝对路径和相对路径?请更新您的问题并与我们分享文件夹结构和路径
  • @MohitKumar 是啊……包括。也许需要像这样(“../config.php”)。你知道吗?

标签: php html directory require


【解决方案1】:

错误几乎解释了问题所在:you are trying to include a file that is not there.

你必须在dashboard.php页面使用这个:-

require_once("../../dbconn.php");

【讨论】:

  • 成功!!但是为什么我的dashboard.php突然看起来像所有的.js并且引导加载失败?
  • 它也会使用这个路径目录。
  • 我不明白。可以举个例子吗
  • 您的问题是否已通过 .js 和引导文件解决?
猜你喜欢
  • 2018-08-30
  • 2018-03-26
  • 2013-01-24
  • 2018-12-01
  • 1970-01-01
  • 1970-01-01
  • 2022-10-16
  • 1970-01-01
  • 2016-07-10
相关资源
最近更新 更多