This is driving us all nuts.
We have an IIS web server running php using wincache.
In iis we have the document root and a second part of the website mapped using a virtual directory.
First, here is the error:
PHP Fatal error: session_start(): Failed to initialize storage module: wincache (path: C:\Windows\Temp)
We got the error to duplicate in a simple 1 line php file:
<?php
session_start();
?>
Here's the kicker
This file throws NO errors if placed anywhere in the root doc folder. BUT once placed in the virtual directory it will work for about 5 min then fail. It will continue to fail until we restart IIS.
We also have 2 servers identically configured. It's working with no issues on of the 2 servers.
It sounds like the IIS application pool ID under which PHP is running does not have permissions to write to C:\Windows\Temp. You should check the ACLs on the folder to see if it is writeable by your app pool identity.
If you don't see BUILTIN\IIS_IUSRS on the ACL, then the default app pool ID can't write to that directory. If you're using a custom user ID for the app pool, you'll need to make sure it's on the ACL for the folder.