我有以下文件结构:
rootDIR dir1 subdir1 file0.php file1.php dir2 file2.php file3.php file4.php
file1.php
需要从dir2中引用file3.php
和file4.php
:
require('../../dir2/file3.php')
file2.php
像这样需要 file1.php
:
require('../dir1/subdir1/file1.php')
但是在file1.php
中,使用require无法打开file3.php
和file4.php
(可能由于路径相对性引起)。
然而,为什么会出现这种情况,我应该如何处理file2.php
,以便file1.php
可以正确地requirefile3.php
和file4.php
?