let's say we have:
To require [root]/lib/classes/class1.php from [root]/lib/config.php we can have:
1. require dirname(__FILE__).'/classes/class1.php';
2. require $_SERVER['DOCUMENT_ROOT'].'/lib/classes/class1.php';
3. require 'classes/class1.php';
First, 3 is not OK (worst case) because if our "config.php" is required by another file, from another folder, the path will not be valid anymore.
Let's say that in [root]/lib/classes/class1.php we have require '../config.php'; the final content of the file (class1.php + the include) will be:
1) and 2) use absolute server path so you cannot fail BUT if the website is moved into a folder (it's a strange case, but it can happen - the server is changed and the DOCUMENT_ROOT is not the same or you need a [beta] folder of the website), we'll have:
// -- and this will produce
require 'classes/class1.php'; // (from our config.php)
// -- fatal error: we try to require [root]/lib/classes/classes/class1.php - not here!
In case (2), instead of
In the (1)st case everything it's compatible.
No changes are needed. It's just a better practice that I would suggest.