【发布时间】:2012-05-30 02:46:05
【问题描述】:
只是想知道我在这里做错了什么。我一直在设置一个linux开发环境。如果我这样做:
include 'test.php';
效果很好。
如果我将 test.php 文件移动到名为 test 的文件夹中并执行以下操作:
include 'test/test.php';
失败了。怎么回事?
我也试过了:
include '/var/www/site/test/test.php';
include '/test/test.php';
include '../test/test.php';
等等,没有运气。
【问题讨论】:
-
也许你正在使用某种 url 重写?
-
权限可能有误
-
请给出错误。语法似乎正确。
-
在您尝试包含的文件中,放置
echo getcwd();并让我们知道当前工作目录是什么。 -
'test/' 位于根文件夹中,而 'test.php' 位于当前(包括调用/启动)文件夹中。
标签: php ubuntu include include-path