在php
,// stdin 1 => [“ pipe”,“ w”],// stdout 2 => [“ pipe”,“ w”],// stderr ]; //执行命令 $ process = proc_open('./ test.sh',$ distibcriptorspec,$ pipes,dirname(__ file __),null); //从输出流读取 $ stdout = stream_get_contents($ pipes [1]); fclose($ pipes [1]); $ stderr = stream_get_contents($ pipes [2]); fclose($ pipes [2]); //输出结果 Echo“ stdout:\ n”; var_dump($ stdout); Echo“ stderr:\ n”; var_dump($ stderr);
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3