我已经去了这两个主题:为PHP相对路径需要文件
- include, require and relative paths
- PHP - with require_once/include/require, the path is relative to what?
,不能让我的脚本工作,没有提出的方法正在工作,或者我做错了什么。
反正这是我的问题的出现位置:
Root/ //this is root location for server
APP/ //this is root location for script
Root/APP/core/init.php //this is where I include classes and functions from
Root/APP/classes/some_class.php //this is where all classes are
Root/APP/functions/some_function.php //this is where all functions are
所以很明显,我需要包括init.php
无所不在,所以我在这样每个文件所做的:
require_once 'core/init.php';
这是工作,直到我有决定创建一个这样的管理文件的位置:
Root/APP/Admin/some_admin_file.php
当我包括初始化这样:
require_once '../core/init.php';
脚本未能打开功能,没有这样的文件在APP/Core/
文件夹 所以我用DIR方法上面甚至比古怪的事情话题提出发生,错误:
no such file in APP/Core/classes/Admin/
那是什么? :d我迷路了这一点,可能有人扶了一下;)
检查字母大小写,是否在这样的大写字母中:APP/Core /或APP/core /,其中之一是错误的 – Ayub