What are the best practices for including PHP files in scripts to ensure consistent functionality across different server setups?

When including PHP files in scripts, it is important to use the correct file paths to ensure consistent functionality across different server setups. One way to achieve this is by using the `__DIR__` magic constant to reference the current directory of the script, which helps avoid issues with relative paths. Additionally, using `require_once` instead of `include` can help prevent multiple inclusions of the same file.

<?php
require_once __DIR__ . '/path/to/include.php';
// Your script code here
?>