我有以下文件结构
--插件
-- inParent.php
-上传
- inSame.php
- Uploadify.php
直到昨天,这个功能都运行得很顺利。但现在,如果我尝试使用require_once('../inparent.php),It to auploadify.php将inParent.php包含在uploadify.php中,则会得到一个愚蠢的error..saying...
Warning: require_once(../inParent.php) [function.require-once]: failed to open stream: No such file or directory in /home/user/public_html/plugins/uploadify/uploadify.php on line 3
但这个文件确实存在。
当用于包含inSame.php时,相同的代码没有显示任何错误,并且工作正常。
我猜可能是文件权限问题..但一切都是fine..all的,相关文件有755/644权限。
此外,move_uploaded_file函数也已停止工作。
直到昨天,所有的代码都运行得很好。我什么都没改变。
我什么都试过了,不知道到底发生了什么.
朋友们,请帮帮我..:( :(
发布于 2013-07-12 22:51:19
我用谷歌搜索了一下,找到了这个:require_once __DIR__.'/../inParent.php';
发布于 2018-07-25 06:49:03
在我的例子中,我不得不写:
require_once dirname( __FILE__ ) . '/' . '../../inParent.php';
这就成功了!
发布于 2020-07-27 06:10:17
这个问题很老了,但是对于像我这样遇到它的人来说,这是来自Stack Overflow的另一个部分的答案。
Require_once($_SERVER‘’DOCUMENT_ROOT‘。'/inParent.php');
https://stackoverflow.com/questions/12242964
复制相似问题