Reading standard error : popen « File Directory « PHP






Reading standard error

 
<?php
$ph = popen('strace ls 2>&1','r') or die($php_errormsg);
while (!feof($ph)) {
    $s = fgets($ph)               or die($php_errormsg);
}
pclose($ph)                       or die($php_errormsg);
?>
  
  








Related examples in the same category

1.Using popen() and pclose()
2.Using popen() to Pass Data to the column Application
3.Using popen() to Read the Output of the Unix who Command
4.Using popen() with nsupdate
5.Reading output from popen()
6.Opening a Process File Pointer with popen()
7.Opening a Unidirectional Pipe Using popen()
8.Redirecting standard output