exec or system in windowz to stop mysql or apache from remote (and restart them)
| From: | (Delbono) | Date: | Mon, 27 Nov 2000 10:30:25 +0000 |
| Subject: | exec or system in windowz to stop mysql or apache from remote (and restart them) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27328@lists.php.net to get a copy of this message | ||
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