How does the working directory affect the inclusion of files in PHP scripts, and what considerations should be made?

When including files in PHP scripts, the working directory affects the path resolution. To ensure that files are included correctly, it's important to use absolute paths or relative paths that are relative to the current script's location. Additionally, it's good practice to set the working directory explicitly using `chdir()` if needed.

// Set the working directory explicitly
chdir(__DIR__);

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

// Include file using relative path
include_once('path/to/file.php');