Is it recommended to use absolute paths or relative paths when including external PHP libraries like PHPMailer in scripts?

When including external PHP libraries like PHPMailer in scripts, it is generally recommended to use absolute paths to ensure that the library is always correctly included regardless of the current working directory. This helps prevent issues with file path resolution and ensures that the script can find and use the library files consistently.

require_once('/path/to/PHPMailer/PHPMailer.php');
require_once('/path/to/PHPMailer/SMTP.php');
require_once('/path/to/PHPMailer/Exception.php');

// Your script code using PHPMailer here