Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.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
php不需要选择需要的文件_Php - Fatal编程技术网

php不需要选择需要的文件

php不需要选择需要的文件,php,Php,我的项目有以下文件夹结构 /MelaClass ../xml interface.php ../grid table.php 在顶部的table.php中,我使用了require'../interface.php',但是 致命错误:require():无法打开所需的“/../interface.php” (将_path=';C:\php\pear')包含在 H:\wamp\www#MedICUs\MedICUs\MelaClass\xml\grid\table

我的项目有以下文件夹结构

/MelaClass
  ../xml
    interface.php
    ../grid
       table.php
在顶部的table.php中,我使用了
require'../interface.php'
,但是

致命错误:require():无法打开所需的“/../interface.php” (将_path=';C:\php\pear')包含在 H:\wamp\www#MedICUs\MedICUs\MelaClass\xml\grid\table.php,第3行

为什么会这样<代码>。/有一个文件夹在上面吗

尝试使用以下方法:

require dirname(__FILE__) . '/../interface.php';
它将使用文件目录的当前完整路径,向上一级添加
interface.php

试试这个

dirname(dirname( __ FILE__)).'/interface.php'

1.请向我们显示完整的错误消息,您还可以看到它试图包含的完整路径2。您使用IIS服务器吗?它是从包含table.php的文件夹到包含interface.php的文件夹的一个文件夹;但不一定是从当前工作目录(getcwd())到包含interface.phpUse
require\uuuu DIR\uuu.'//php“
如果您不知道当前的工作目录