Well I was able to figure out a real clumsy work around. I wasn't able to find any "real" solution which suprises me. I am new to PHP so I could just have been looking for the wrong thing, but it doesn't look like there is anyway to dynamically declare the root directory.
If anyone else is looking for an answer, here is my work around.
I updated the /etc/apache/php/ini with the following line:
Code:
auto_prepend_file = /var/www/htdocs/global-vars.php
This server will "force" include the file at beginning of every php script. in 'global-vars.php' you just set a global var to "/var/www/htdocs" then all of your includes can be called as so:
Code:
$returnCode = include("$ROOT/folder/script.php")
Or however you wish to "include".
Also, FYI: this only applies to include files, any other kind of linking or url redirection still works by linking relative to the htdocs root.
regards,
...drkstr
**edit**
incase you are asking why I just don't link relative to the directory calling the include ...
The problem you run into is when you have lib files that use an include but might get called from diffrent directories. This is what tipped me off to the problem to begin with.