note 79643 modified in function.ssh2-exec by danbrown
| From: | danbrown@php.net | Date: | Wed, 17 Feb 2010 14:53:47 +0000 |
| Subject: | note 79643 modified in function.ssh2-exec by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166069@lists.php.net to get a copy of this message | ||
if you are using exec function, and have problems with a output > 1000 lines
you should use
<?php
stream_set_blocking($stream, true);
while($line = fgets($stream)) {
flush();
echo $line."<br />";
}
?>
except
<?php
stream_set_blocking($stream, true);
echo stream_get_contents($stream);
?>
--was--
if you are using exec function, and have problems with a output > 1000 lines
you should use
stream_set_blocking($stream, true);
while($line = fgets($stream)) {
flush();
echo $line."<br />";
}
except
stream_set_blocking($stream, true);
echo stream_get_contents($stream);
http://php.net/manual/en/function.ssh2-exec.php