PHP :: SSH2 ??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can anybody give me a small example on using 
ssh2 functions ( http://pecl.php.net/package/ssh2 ).

I want to execute a command on the remote machine and 
want to get the ouput into a phpvariable.

Here is my php code ... 
<?php
$connection = ssh2_connect('127.0.0.1', 22);
ssh2_auth_password($connection, 'root', 'myrootpassword');
$stream = ssh2_exec($connection, 'uptime');
echo $stream;
?>

I'm getting some "Resource id #5" as output.
What does this mean. How to get the actual output of my remote command.

I'm using PHP-4.3.10

best regards,
/Chandu

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux