How can the use of absolute paths in PHP include statements help prevent problems during server migrations or directory structure changes?

Using absolute paths in PHP include statements ensures that the file being included is always referenced from the same starting point, regardless of the current working directory. This helps prevent issues during server migrations or directory structure changes because the include statement will always point to the correct file location.

include_once(__DIR__ . '/path/to/file.php');