I have multiple sub-domains within the document_root. And multiple folders/classes within those sub-domain folders. I need something that will help me with my include_once paths, but $_SERVER[DOCUMENT_ROOT] goes too far down. And if I were to use this, and transfer the website folder later, all my include_once paths will/might break.
Hope my question is clear… Any recommendations?
Essentially, what I’m trying to do is, access classes, that are located in different folders, from different files. When it works for some files, it’ll break in others, because of the way I’m writing the include statements.
Ie. class test{include_once ‘../Data/employee.php’;}
A file that will include the class test, will work. But say another file, from a different directory, includes the class test. It’ll break. Because the other file can be 3 folders deep, instead of just one.
You can set include path per sub-domain (inside the
<virtualhost>) using Apache’sphp_valuedirective.