Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are exec and proc_open running under different user on IIS?

I'm running my site on Windows Server 2012 R2 and IIS 8.5 and I encountered a problem.

  • When I run exec('whoami'), it returns nt authority\iusr.
  • When I run proc_open('whoami', $desc, $pipes), the result is iis apppool\mysite.

Why is this happening?

like image 515
Jan Voráček Avatar asked Nov 09 '22 02:11

Jan Voráček


1 Answers

that is interesting. It must have to do with the nature of proc_open. Somehow its going to the share iis pool which has different permissions than the standard user used on IIS. proc_open has you might already know requests a greater level of control and php under windows is probably needing additional permissions to get that.

like image 193
mike_l Avatar answered Nov 14 '22 23:11

mike_l