How can the use of relative paths in include statements impact the execution of PHP scripts in different directories?
Using relative paths in include statements can impact the execution of PHP scripts in different directories because the path will be relative to the current working directory of the script. This can lead to errors if the script is executed from a different directory than the one where the included file is located. To solve this issue, it's recommended to use absolute paths or the `__DIR__` magic constant to ensure that the include statement always refers to the correct file location.
include __DIR__ . '/path/to/file.php';