require_once显示警告和致命错误,但在正确的目录下。

问题描述 投票:0回答:1

我的网站一直在正常运行,直到我创建index.php并显示出这个错误信息。

警告: require_once(._assetfakervendorfzaninottofakersrcautoload.php): 打开流失败。在C:x/ampp/htdocs/belajar/covid_config/config.php的第10行没有这个文件或目录。

致命的错误: require_once()._assetfakervendorfzaninottofakersrcautoload.php(include_path=C:\xampp\php\PEAR)。Failed open required '._assetfakervendorfzaninottofakersrcautoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\belajar\covid_config\config.php 第10行。

这是我的程序,可能会导致错误(index.php)。

include "_config/config.php";

这是我的config.php

require_once "../_asset/faker/vendor/fzaninotto/faker/src/autoload.php";

我的文件夹表格:从htdocs开始。

belajar-covid-_asset
             |-_config
             |-auth
             |-dashboard
             |-index.php
php require
1个回答
0
投票

require, require_once, includeinclude_once 语句,PHP按照以下优先级搜索源文件。

  1. 完整的路径名,如果有的话(例如 include 'c:/my_include/autoload.php';)
  2. include_path (在你的情况下是 C:\xampp\php\PEAR)
  3. 调用脚本自己的目录
  4. 当前工作目录

您所需要的文件('._assetfakervendorfzaninottofakersrcautoload.php')不在这些位置。

详情请看PHP手册

© www.soinside.com 2019 - 2024. All rights reserved.