I have file structure like so:
root
-folderA/file1
--folderB/file2
---folderC/file3
----folderD/file4
In file2
, I use require('../file1')
and it works fine. However, in file4
, I use require('../../../file1')
and there is no output.
I have checked the path to make sure file_exists
and is_readable
. I used:
try{ }catch(exception){ }
with no results.
I then copy-pasted my source code in file2
(knowing that it works) into file4
, changing only the relative path. No output again.
Any help is appreciated. Thanks.