I've used the dot-slash ./ directory to include files but it seems to work only with files in the root folder. For example, in /script.php, include('./dir/inc.php'); will include /dir/inc.php, but in /anotherdir/script.php, the same include command is used but PHP gives a warning that there's No such file or directory in my root folder.
Any ideas what I should try before resorting to using a multitude of dot-dot-slashes ../../../ in include commands depending on the files?