file_exists() works when executed from phpunit, but not from web page

Viewed 129

I have a file on a network shared location, and I want to check if it exists programmatically with PHP.

When running from PhpUnit, it works fine. My minimal test is:

public function testBackupFileExists () {
  $backup_pname = 'R:\myFolder\mySubFolder\myFile.csv';
  $this->assertTrue (file_exists ($backup_pname), "File $backup_pname not found");
}

When running from a web interface, from my localhost, file_exists() returns false...

They both use the same version of PHP (7.4.1) and are both executed from the same machine. I also tried running clearstatcache(), but it doesn't work.

0 Answers
Related