I am trying to read the content of an existing file:
clearstatcache();
$fileName = "/tmp/.netscan";
$fp = fopen($fileName, "rb");
if ( !$fp ) {
throw new Exception('File open failed.');
}
$str = stream_get_contents($fp);
fclose($fp);
even though the file exists, I get the message:
“fopen(/tmp/.netscan): failed to open stream: No such file or directory”
$ ls -la /tmp/.netscan
-rwxrwxrwx 1 www-data www-data 33 Okt 9 15:59 /tmp/.netscan