【发布时间】:2011-02-21 01:18:57
【问题描述】:
在我的代码中的许多地方,我会做如下的事情:
file1.php:
<?php
include('../file2.php');
file2.php:
<?php
include('anotherdirectory/file3.php');
根据我尝试使用的服务器或设置,它可以设置来自“包含器”或“包含器”的相对路径。这真的很令人困惑。 所以 file1 可能会尝试包含“../anotherdirectory/file3.php”,也可能会尝试包含“anotherdirectory/file3.php”。
什么设置决定了这种行为?我想控制这个...
【问题讨论】:
标签: php include relative-path