Re: Restarting windows from php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux