Which user does PHP/IIS6 use to read/write files?

Solution 1:

Craig is right, the default for IIS6, will be running as the NETWORK SERVICE account; using PHPinfo in a test.php is a great way to diagnose this.

I blogged about the "identity" of code running in IIS here by OS

Hope that helps.

Dave

Solution 2:

I imagine it'll use whatever user you're running the IIS service as. But here's a quick and easy way to find out:

  1. Drop the following lines into a file called test.php: <?php phpinfo(); ?>

  2. Put test.php under the IIS document root and view it in a browser

  3. Look for a line in the output containing the username, it's definitely in there somewhere.

Solution 3:

You need to change in php.ini:

fastcgi.impersonate = 1;

So, PHP uses the same account of your IIS (w3wp.exe) uses. (User: IUSR).