|
Posted by Varlamov Konstantyn on 07/06/07 06:32
Tis is not work to
<?php
$connection = ssh2_connect("login", 22);
if (! $connection) {
die("Connection failed.");
}
else echo "connect OK";
if (! ssh2_auth_password($connection,"user","test")) {
die("Auth failed.");
}
else echo "login OK";
sleep(10);
$stream=ssh2_exec($connection,"show log");
stream_set_blocking($stream, true);
$output = stream_get_contents($stream);
?>
connect OKlogin OK
Warning: ssh2_exec(): Unable to request command execution on remote host
in /home/konstantyn/www/php/test.php5 on line 22
Warning: stream_set_blocking(): supplied argument is not a valid stream
resource in /home/konstantyn/www/php/test.php5 on line 25
Warning: stream_get_contents() expects parameter 1 to be resource,
boolean given in /home/konstantyn/www/php/test.php5 on line 26
[Back to original message]
|