Re: exec or system in windowz to stop mysql or apache from remote (and restart them)
| From: | Ignacio Vazquez-Abrams | Date: | Mon, 27 Nov 2000 15:03:39 +0000 |
| Subject: | Re: exec or system in windowz to stop mysql or apache from remote (and restart them) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27381@lists.php.net to get a copy of this message | ||
On Mon, 27 Nov 2000, Delbono wrote:
> Hello,
>
> did any of you experiment EXEC or PASSTHRU or SYSTEM in windows?
>
> I tried:
>
> <?
> $cmd = "c:\apache\htdocs\ec.bat";
> system($cmd, $out);
> echo $out;
> exit;
>
> ?>
>
> Where ec.bat is simply:
>
> echo "done"
> exit
>
>
> (dos batch commands)
>
> If I execute the exec.php file, a dos win pops up, executes the echo
> command, exits, but in the browser nothing happens. And php hangs to wait
> for something, like it is described in the manual.
>
> I read I have to pass output to a file or something but don't know how.
> I saw samples for linux, but I work with dos/win and those examples don't
> work for me (Or I'm not able to get them working)
>
>
> Do you have any advice for me? Or working sample?
>
>
>
>
> For the fact that the dos win pops up I can modify ALLOW APPLICATION TO
> INTERACT WITH DESKTOP directive, but for the rest I don't know.
>
>
>
> // I'd like to be able to stop-restart Mysqld from remote and even try to
> stop/restart apache from remote..
> with a batch file.
> Thnaks
>
The process execution functions/commands (exec(), passthru(), system(), and
``) don't currently work under Win32. Try using COM to have another program
execute the batch file.
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>