你會想爲此使用php函數proc_open - 你可以指定一個管道數組(標準輸入,如果你在控制檯,標準輸出和標準輸入,通常會連接到鍵盤上)通常會打印到顯示屏上)。然後,您可以控制給定的程序
這樣的輸入/輸出folw爲例:
$pipes = array();
$pipe_descriptions = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("pipe", "w"), // stdout is a pipe that the child will write to
2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to
);
$cmd = "wget $url";
$proc_handle = proc_open($cmd, $pipe_descriptions, $pipes);
if(is_resource($proc_handle))
{
// Your process is running. You may now read it's output with fread($pipes[1]) and fread($pipes[2])
// Send input to your program with fwrite($pipes[0])
// remember to fclose() all pipes and fclose() the process when you're done!
怎樣的用戶連接到服務器? SSH還是什麼? – n1313 2009-08-28 09:53:25
用戶不通過SSH進行連接。用戶只需進入S上的網頁。服務器通過SSH或專有服務器軟件連接到其Intranet中的計算機,但我對SSH選項的解決方案感興趣。 – 2009-08-28 11:04:33