6

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!

4 Answers4

3

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

1

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.

David North
  • 762
  • 1
  • 5
  • 12
1

You need to change in php.ini:

fastcgi.impersonate = 1;

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

Nixphoe
  • 4,524
  • 7
  • 32
  • 51
0

In IIS6 the default worker process user is NETWORK SERVICE. If you open the Task Manager, the w3wp.exe process will likely be running as this account.

Also, the ASPNET user is a carryover from IIS5. Unless you have IIS6 configured to use "IIS5 isolation mode" ASP.NET would also "run" under the NETWORK SERVICE account.

Craig
  • 274
  • 1
  • 5