Directory structure
A.php includes B.php and B.php includes C.php.
But B.php needs to include C.php relative to A.php. Is there a way to include C.php relative to B.php?
You can enable the use of __DIR__ or dirname(__FILE__) .
__DIR__
dirname(__FILE__)
From the manual
File directory. If used inside a include, the directory returns the returned file. This is equivalent to dirname(__FILE__) .
try it
include_once(__DIR__.'/folder/B.php'); include_once(__DIR__.'/folder/C.php');
include_once(__DIR__.'/A.php');