What are common pitfalls when using PHP include statements?

Common pitfalls when using PHP include statements include using relative paths that may not resolve correctly, leading to file not found errors. To avoid this, it's recommended to use absolute paths or define a constant for the base directory of your project and use it in include statements.

// Define a constant for the base directory of your project
define('BASE_PATH', __DIR__);

// Use the constant in include statements
include(BASE_PATH . '/path/to/file.php');