I\'ve tried to get output from proc_open
method in php, but, when I print it, I got empty.
$descriptorspec = array( 0 => array(\"pipe\", \"r\"),
this is another example with proc_open()
.
I am using Win32 ping.exe command in this example. CMIIW
set_time_limit(1800);
ob_implicit_flush(true);
$exe_command = 'C:\\Windows\\System32\\ping.exe -t google.com';
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout -> we use this
2 => array("pipe", "w") // stderr
);
$process = proc_open($exe_command, $descriptorspec, $pipes);
if (is_resource($process))
{
while( ! feof($pipes[1]))
{
$return_message = fgets($pipes[1], 1024);
if (strlen($return_message) == 0) break;
echo $return_message.'
';
ob_flush();
flush();
}
}
Hope this helps =)