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“
如果您不知道当前的工作目录