note 73808 added to function.ssh2-exec
| From: | Jon-EirikPettersen at osu1 dot php dot net | Date: | Sun, 11 Mar 2007 12:33:41 +0000 |
| Subject: | note 73808 added to function.ssh2-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124321@lists.php.net to get a copy of this message | ||
The command may not finish before the function return if the stream is not set to blocking mode.
You may have to set the stream to blocking mode in order to get any output from the command.
<?php
// [Open connection]
// ...
$stream = ssh2_exec($connection, 'ps ax');
stream_set_blocking($stream, true);
// The command may not finish properly if the stream is not read to end
$output = stream_get_contents($stream);
// ...
// [Close stream and connection]
?>
----
Server IP: 62.73.196.231
Probable Submitter: 80.89.53.14
----
Manual Page -- http://www.php.net/manual/en/function.ssh2-exec.php
Edit -- https://master.php.net/note/edit/73808
Del: integrated -- https://master.php.net/note/delete/73808/integrated
Del: useless -- https://master.php.net/note/delete/73808/useless
Del: bad code -- https://master.php.net/note/delete/73808/bad+code
Del: spam -- https://master.php.net/note/delete/73808/spam
Del: non-english -- https://master.php.net/note/delete/73808/non-english
Del: in docs -- https://master.php.net/note/delete/73808/in+docs
Del: other reasons-- https://master.php.net/note/delete/73808
Reject -- https://master.php.net/note/reject/73808
Search -- https://master.php.net/manage/user-notes.php