In what scenarios would it be advisable to use absolute paths instead of relative paths in PHP scripts?

When working with PHP scripts, it may be advisable to use absolute paths instead of relative paths when dealing with files that are located in different directories or when the script needs to access resources outside of its current directory. Absolute paths provide a fixed reference point to the file's location, ensuring that the script can always find the file regardless of its current working directory.

// Using absolute path to include a file
include_once('/var/www/html/includes/config.php');