河汉清且浅,牵牛敦而纯

如何获取 PHP exec() 错误响应?

  

 ob_start();
 exec($cmd . " 2>&1", $output);
 $result = ob_get_contents();
 ob_end_clean();
 var_dump($output);

  

https://stackoverflow.com/questions/345794/how-to-retrieve-php-exec-error-responses
posted on 2025-07-24 02:46  伊索  阅读(3)  评论(0)    收藏  举报