I am running PHP through IIS on windows, and using the Integrated Authentication for using domain users.
The following code works when accessing a page in IE 11, Chrome and Firefox.
$dir = dirname(__FILE__);
$dir = realpath($dir.'/../storage/logs');
$filename = $dir.DIRECTORY_SEPARATOR.'my-log.log';
file_put_contents($filename, 'hello world');
When accessed in MS Edge
PHP Warning: file_put_contents(C:\websites\my-site\api\storage\logs\my-log.log):
failed to open stream: Permission denied in
C:\websites\my-site\api\public\permissions.php on line 11
(It works in the Edge-Dev that is based on Chromium, it is only a problem in the traditional / EdgeHTML version that has the problem.)
The code works in Edge too if I turn off the windows authentication. I know that I am typing my password correctly because if I don't I get a 401 unauthorised message from IIS.
This issue is not just my computer; it has failed on all 4 laptops we've tried it on. But does not seem to affect servers, only desktop Windows.
Update
As per Deepak-MSFT's suggestion I added my computer's name to the intranet, but it didn't change anything. The name is like laptop-4.example.com
I added it both with and without http and *.example.com
was already in trusted sites, leaving it in or removing it does not seem to change anything.