Commit 7973d638 by 张思远

a

parent a4bb6cbb
Pipeline #175 passed with stage
in 11 seconds
...@@ -41,35 +41,3 @@ if ($stderr) { ...@@ -41,35 +41,3 @@ if ($stderr) {
} }
echo '</dl>'; echo '</dl>';
echo 'linux远程:<br>';
$cmd = 'bash t1.sh';
$descriptorspec = [
["pipe", "r"], // stdin
["pipe", "w"], // stdout
["pipe", "w"], // stderr
];
$proc = proc_open($cmd, $descriptorspec, $pipes, null, null);
if ($proc == false) {
// do sth with HTTP response
} else {
$stdout = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$stderr = stream_get_contents($pipes[2]);
fclose($pipes[2]);
$status = proc_close($proc); // 释放proc
}
echo '<dl>';
echo '<dt>输出</dt>';
echo '<dd><pre>' . $stdout . '</pre></dd>';
if ($stderr) {
// echo '<dt>出错了!</dt>';
echo '<dd><pre>' . $stderr . '</pre></dd>';
}
echo '</dl>';
exit;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment