Illuminati Posted March 13, 2007 Share Posted March 13, 2007 I am trying to make a website where I can restart an application. I can make it terminate the app but it hangs when trying to restart it. the website calls the function this way: ##################### PHP ##################### <?php if (isset($_POST["kill_server"])){ kill_server(); echo "<img src=./images/ok.gif> El server esta siendo apagado. Por favor espere 1 minuto!"; } elseif (isset($_POST["init_server"])){ init_server(); echo "<img src=./images/ok.gif> El server esta siendo iniciado. Por favor espere 3 minutos!"; } ?> ##################### HTML ##################### <form action="" method="post" name="kill_server" id="restart_server"> <input type="submit" name="kill_server" value="Kill Server"> </form> <form action="" method="post" name="init_server" id="restart_server"> <input type="submit" name="init_server" value="Init Server"> </form> The functions being called are these: <?php function kill_server (){ require("includes/log_functions.php"); $logfile = "logs/server_kill.php"; writelog::writelog_server_kill($logfile); passthru("c:\scripts\kill.bat"); } function init_server (){ require("includes/log_functions.php"); $logfile = "logs/server_init.php"; writelog::writelog_server_init($logfile); passthru("notepad"); } ?> The first function works just fine, but the second one hangs. The batch file just calls for notepad.exe so it's nothing big. Any help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/42443-help-with-passthru-or-exec/ Share on other sites More sharing options...
Illuminati Posted March 13, 2007 Author Share Posted March 13, 2007 I also tried to make a batch file and make the second function call it just like the first function calls kill.bat, the result was the same, it hangs. Link to comment https://forums.phpfreaks.com/topic/42443-help-with-passthru-or-exec/#findComment-205896 Share on other sites More sharing options...
Illuminati Posted March 15, 2007 Author Share Posted March 15, 2007 anyone? Link to comment https://forums.phpfreaks.com/topic/42443-help-with-passthru-or-exec/#findComment-207775 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.