我试图从proc_open
方法在PHP中获得输出,但是,当我打印它时,我变空了。如何获得输出proc_open()
$descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("file", "files/temp/error-output.txt", "a") ); $process = proc_open("time ./a a.out", $descriptorspec, $pipes, $cwd);
只要我知道,我可以得到stream_get_contents()
echo stream_get_contents($pipes[1]); fclose($pipes[1]);
输出但我不能这样做.. 什么建议吗?
THX前...
哈哈,你的代码实际上让我明白了如何proc_open的作品。 – Yoshiyahu 2012-05-03 19:24:30
@Yoshiyahu哈哈,很高兴知道.. :) – 2012-06-08 08:49:42