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

12,220

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).

Share:
12,220

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    I've installed PHP5 (FastCGI) on IIS6 and is just wondering which windows user PHP uses to access the file system?

    With ASP.NET for example, the ASPNET account is used to access the file system. But how about PHP?

    I've read some post that suggest it uses the anonymous (i.e. IUSR) account. But isn't it a security breach if I give write access to the IUSR account?

    Thanks!