You are here: Re: [PHP] Restarting windows from php « PHP « IT news, forums, messages
Re: [PHP] Restarting windows from php

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация