title: PHP exec(), shell_exec(), system(), passthru() do not work on Windows 7/IIS
body: <p>I'm using Windows 7 x64 Enterprise, IIS, and PHP 5.6.32 in my development environment. My application's website has the following settings:</p>
  
  <ul>
  <li>Anonymous authentication: disabled</li>
  <li>Windows authentication: enabled (Negotiate, Negotiate:Kerboeros, NTLM)</li>
  <li>App Pool: domain account.</li>
  <li>Other than the default PHP extensions, I have Microsoft's PHP SQL Server driver (3.2 version) used in Windows Authentication mode.</li>
  </ul>
  
  <p>My production server is the same setup running on Server 2008 R2.</p>
  
  <p>I am needing to use <code>exec()</code>, <code>shell_exec()</code>, etc. to execute an executable (pdftk if it matters). However, whenever I use any of these functions, I always get <code>"Unable to fork XXX"</code> in the PHP error log. I've tried runing <code>whoami</code>, <code>ping xxx</code>, and other simple commands with the same result. None of the typical shell functions will work--they always result in the same error. I have checked my <code>php.ini</code> file and verified those functions haven't been disabled.</p>
  
  <p>However, in my production environment, <strong>I do not have this problem</strong>, and I have no clue why. It only seems to be affecting my development environment. During my research, I did stumble across this (<a href="http://tech.trailmax.info/2012/12/php-warning-shell_exec-unable-to-execute-on-iis-7/" rel="nofollow noreferrer">http://tech.trailmax.info/2012/12/php-warning-shell_exec-unable-to-execute-on-iis-7/</a>) which, for some reason, does fix my problem; but, it completely breaks my SQL Server Windows authentication (which I need).</p>
  
  <p>I have also disabled my antivirus in hopes maybe it was the culprit. It was not.</p>
  
  <p>While doing more troubleshooting, I did find that <code>proc_open()</code> does work. We are using Prince for generating PDFs and I noticed it was working, while my <code>exec()</code> wasn't. When I looked at the Prince class, I discovered it was using <code>proc_open()</code> which explains why it seems to work.</p>
  
  <p>Does anyone know why <code>exec()</code> and the related functions seem to work without issue in my production environment and not my development environment? And why does <code>proc_open()</code> work but the other shell functions do not? Thanks!</p>