【问题标题】:failed to open stream: No such file or directory but file exist无法打开流:没有这样的文件或目录,但文件存在
【发布时间】:2022-06-19 23:11:43
【问题描述】:

当我试图将 test.php 移动到文件夹 test/ 时,在 test.php 内部我肯定存在 include '../include/functions/header.php'; 文件,因为当我在 htdocs 中使用 test.php 时我没有错误

我得到错误

Warning: include(config.php): failed to open stream: No such file or directory in D:\DevWeb\htdocs\include\functions\header.php on line 1
Warning: include(include/functions/version.php): failed to open stream: No such file or directory in D:\DevWeb\htdocs\include\functions\header.php on line 2

等等……

在 header.php 我有

include 'config.php';
include 'include/functions/version.php';
include 'include/functions/language.php';
require_once ("include/classes/user.php");
include 'include/functions/json.php';
include 'include/functions/social-links.php';
include 'include/functions/pages.php';```

【问题讨论】:

    标签: php


    【解决方案1】:

    你需要改变你的进口。 config.php 的相对路径将是 '../config.php'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-04
      • 1970-01-01
      • 2013-01-13
      • 2015-07-29
      相关资源
      最近更新 更多