What are some common pitfalls or errors that can occur when using the include command in PHP?

One common pitfall when using the include command in PHP is not specifying the correct file path, leading to a "file not found" error. To solve this issue, always double-check the file path and ensure that it is relative to the current working directory or use an absolute path for the file.

// Incorrect include with wrong file path
include 'utils/functions.php'; // This may result in a "file not found" error

// Correct include with absolute file path
include __DIR__ . '/utils/functions.php'; // Using absolute path to include the file