In what ways can incorrect file paths in PHP scripts lead to errors and how should file paths be correctly referenced for smooth script execution?

Incorrect file paths in PHP scripts can lead to errors such as "file not found" or "permission denied". To ensure smooth script execution, file paths should be correctly referenced by using absolute paths or relative paths based on the script's location. It's important to double-check file paths and ensure they are accurate to avoid any issues.

// Incorrect file path
include('utils/functions.php');

// Correct file path using absolute path
include(__DIR__ . '/utils/functions.php');