What is the common error message encountered when trying to open a file stream in PHP?

When trying to open a file stream in PHP, a common error message encountered is "failed to open stream: No such file or directory". This error occurs when the file path provided is incorrect or the file does not exist. To solve this issue, double-check the file path and ensure that the file exists at the specified location.

$file_path = "/path/to/file.txt";

if (file_exists($file_path)) {
    $file = fopen($file_path, "r");
    // Process the file
    fclose($file);
} else {
    echo "File does not exist.";
}