What are the common pitfalls to be aware of when including external PHP files in a project?

One common pitfall when including external PHP files is the risk of exposing sensitive information, such as database credentials, if the included file is accessed directly by a user. To prevent this, you can use the `__DIR__` constant to ensure that the included file is only accessible within the project directory.

// Include external PHP file securely
include_once(__DIR__ . '/path/to/external/file.php');