Running Windows commands from PHP over IIS

In order to run Windows commands via PHP functions such as open_proc(), apparently one has to grant read/execute permissions to the account under which IIS is running (usually IUSR_<servername>) on C:\WINDOWS\System32\cmd.exe. Be sure to do this for web apps that rely on external commands.

This of course took me an eternity to figure out. I was only able to piece together WebSVN‘s bizarre Windows mis-behavior after scouring through the remnants of forum posts limboed in Google cache. PHP.net of course has no proper details on this, though I do now better understand what proc_open‘s obscure and undocumented bypass_shell parameter might be about.

Ah yes, PHP on Windows. Obscure and irritating.

Kind of like me. Not that that makes it any better.

One thought on “Running Windows commands from PHP over IIS

  1. Note: If you are using Apache, instead of IIS, the same still applies. Moreover, I was having similar problems with Appache / PHP commands not running Windows based commands, but then I read this post, adjusted the user at the “services.msc” level for the “Apache” service and BINGO!!!

    Thanks for the obscure, yet insightful post.

    -mmuras

Leave a Reply

Your email address will not be published. Required fields are marked *