PHP system() credentials
Posted on 2004-10-11
I am writing a web-based application to shutdown/reboot WinXP boxes in a lab of 70 systems.
The application has a little GUI map of the lab, each system having a checkbox. You check what you want to reboot, click GO, and a PHP script writes loops executing the Windows "shutdown" command to the remote systems.
Here's the problem:
The "shutdown" command works from a command prompt, but when running the exact same thing from PHP's system() function, it returns a "Access Denied."
So does PHP run programs under different credentials than the logged in user? Does it use the IUSR_xxxx account (when using IIS)? Is there a way to give the system command more "authority"?
I have tried using "runas" with the shutdown command: this also works from a command prompt but not the web page.
Any ideas? Also, any alternate ideas? (am i doing this the hard way?)
It just needs to be web-based, to do from anywhere.