powiem szczerze, że ja tam zawsze ciągnę ścieżkę od pliku wykonawczego i się o nic nie martwię - zawsze wszędzie działa nawet jeśli zmieniam serwer czy coś.
Manual radzi podawać ścieżki na 2 sposoby :
Cytat
a. Do not give absolute path to include files on your server.
b. Dynamically calculate the full path (absolute path)
//One of my typical example is:
<?php
require_once(__ROOT__.'/config.php');
?>
Cytat
skad ta funkcja 'odgaduje' sciezki 'wzgledne'
na zdrowy rozsądek i logikę, jest tak,że każdy 'include' pobiera względem dokumentu wykonawczego, ale jak widać powyżej można tez podawać pełną ścieżkę. jest też coś takiego jak include_patch
znowu kłania się manual
Cytat
Specifies a list of directories where the require, include, fopen(), file(), readfile() and file_get_contents() functions look for files. The format is like the system's PATH environment variable: a list of directories separated with a colon in Unix or semicolon in Windows.
PHP considers each entry in the include path separately when looking for files to include. It will check the first path, and if it doesn't find it, check the next path, until it either locates the included file or returns with a warning or an error. You may modify or set your include path at runtime using set_include_path().