Posted by Stut on 08/10/05 19:10
Karl-Heinz Christian Zeck wrote:
> Does anyone have any idea how to restart windows from a php script?
> I tried the following:
> exec('SHUTDOWN -r -t 01');
> or
> exec('SHUTDOWN /r');
>
> I received the following warning message: Warning: exec(): Unable to
> fork [SHUTDOWN -r -t 01].
There are a couple of possible causes here. First I would try this
instead...
system('shutdown -r -t 1 &');
I don't have a windows machine I can restart at the moment to try this,
but you might have more luck with system than with exec.
Another possible cause is that the user the web server runs as doesn't
have sufficient permissions to initiate a restart. While the error
you're getting doesn't appear to have anything to do with permissions I
would certainly consider it a possibility.
-Stuart
[Back to original message]
|