简体   繁体   English

PHP包含无法打开包含文件的路径

[英]PHP include fail to open path of included files

I'm trying to include file from another php framework but doing so it's giving me an error failing open the stream for the files which are included inside the file I'm trying to include. 我正在尝试包含来自另一个php框架的文件,但是这样做给我一个错误,因为它无法打开要包含在我要包含的文件中的文件的流。

Any idea on how to include it properly so that the files included inside my included file are able to be processed? 关于如何正确包含它的任何想法,以便能够处理包含在我包含的文件中的文件?

在此处输入图片说明

Your include only looks only one directory up. 您的include仅查找一个目录。

include ("../../other/index.php");

would be two directories up so into the "admin" directory then the "other" directory 将是两个目录,因此进入“ admin”目录,然后进入“ other”目录

This has been asked before here 这已经被问过

What Framework are you using? 您正在使用什么框架?

I have little experience with templates but I don't think you should be adding PHP code to a template file. 我对模板的经验很少,但是我不认为您应该将PHP代码添加到模板文件中。

Click Here for another question on how to add PHP code to a template file. 单击此处,以获取有关如何将PHP代码添加到模板文件的另一个问题。

However as far as your path goes, try using: 但是,就您的路径而言,请尝试使用:

include("../../other/index.php");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM