Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t包括名为“的文件”;config.php";在我的PHP应用程序中(它被忽略)_Php_Apache_Xampp_Filenames_Require Once - Fatal编程技术网

Can';t包括名为“的文件”;config.php";在我的PHP应用程序中(它被忽略)

Can';t包括名为“的文件”;config.php";在我的PHP应用程序中(它被忽略),php,apache,xampp,filenames,require-once,Php,Apache,Xampp,Filenames,Require Once,我有以下目录结构: /app /controlers /models /views init.php config.php /www index.php /www/index.php调用init文件的代码: include_once '../app/init.php'; 然后在/app/init.php中,我有: require_once 'config.php'; require_once 'routes.php'; 由于某些原因,conf

我有以下目录结构:

/app
    /controlers
    /models
    /views
    init.php
    config.php
/www
    index.php
/www/index.php调用init文件的代码:

include_once '../app/init.php';
然后在/app/init.php中,我有:

require_once 'config.php';
require_once 'routes.php';
由于某些原因,config.php文件未加载。如果我将其重命名为config2.php并更改include,则一切正常。当我切换回原来的名字时,它又被忽略了。是否有可能以某种方式保留文件名


我正在使用XAMPP附带的Apache。

当您希望包含来自同一目录的文件时,请使用

require_once './config.php';
require_once './routes.php';

否则,您的
include\u路径中具有相同名称的文件可能会被包含

require_once __DIR__.'/config.php';
require_once __DIR__./'routes.php';