I'm trying to debug a huge, antiquated (circa 2001) PHP web service and I'm encountering file open failures. The fopen call is in an included module, the caller is logging that the file could not be opened but no reason is being logged.
The code that actually does the open is:
// Read the file
if (!($fp = @fopen($fileName, 'rb'))) {
$errStr = "Failed to open '{$fileName}' for read.";
break; // try-block
}
How can I find out why fopen failed?
Take away the @ sign.
The @ sign suppresses error messages, so it is supressing the error the the function would normally give.