fusioneko Posted October 18, 2007 Share Posted October 18, 2007 <?php f($_POST['startup']){ if(!$online){ //$A1 = array(); //exec($servpath."khyller-server.exe") or die("<BR>Server Startup MSG - <Font color=red>Cannot find Server</font>"); //proc_open("call C:\Server\blanked\release\khyller-server.exe", $A1,$A2,$A3); } } ?> I'm first trying to get them to work at all just do something first. but with no success I even sued or die and all I get is die D: Is it impossible or am I just dumb? I know I did this one, But I don't know how. Edit to add php color.. my eyes were hurting in blackness. Link to comment https://forums.phpfreaks.com/topic/73743-use-of-the-exec-and-or-proc_open-function/ Share on other sites More sharing options...
trq Posted October 18, 2007 Share Posted October 18, 2007 Pardon? Link to comment https://forums.phpfreaks.com/topic/73743-use-of-the-exec-and-or-proc_open-function/#findComment-372094 Share on other sites More sharing options...
fusioneko Posted October 18, 2007 Author Share Posted October 18, 2007 im tryint o u use proc_open() and or exec() to run an exe file. Link to comment https://forums.phpfreaks.com/topic/73743-use-of-the-exec-and-or-proc_open-function/#findComment-372101 Share on other sites More sharing options...
fusioneko Posted October 18, 2007 Author Share Posted October 18, 2007 <?php require_once("config.php"); if($_GET['page']=="Checkserv"){ $up = fsockopen($servip, $servPort, $errno, $errstr, 1);// or die("Server Connection:<Font color=red><B>FAILED</B></Font>"); if($up){ echo "<BR>Server <Font color=green>Online</Font>"; $online = 1; } else { echo "<BR>Server <Font color=red>Offline</Font>"; $online = 0; } if($_POST['startup']){ if(!$online){ $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("file", "error.txt", "a") ); $pipes = null; $cwd = $servpath; $env = null; $ooption = array("Context"); //exec($servpath."khyller-server.exe") or die("<BR>Server Startup MSG - <Font color=red>Cannot find Server</font>"); $process = proc_open("khyller-server.exe", $descriptorspec,$pipes,$cwd,$env, $ooption); } } if(!$online){ echo "<form action=Admin.php?page=Checkserv method=post><BR>"; echo "<input type=submit name=startup value=StartServer></form>"; } else { // } } ?> So far I got an understanding how to use proc_open, but I wanna keep it open, any idea to make it so php doesn't hang? Link to comment https://forums.phpfreaks.com/topic/73743-use-of-the-exec-and-or-proc_open-function/#findComment-372369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.