Hi, i use php to run certain commands at my remote linux server,
everything works fine, but i cant figure out how to get output of console after executing commands.
I tryed stream_get_cont ents but it does not work :(
Anyone have any ideas?
Thanks in advantage
everything works fine, but i cant figure out how to get output of console after executing commands.
I tryed stream_get_cont ents but it does not work :(
Anyone have any ideas?
Code:
<?php
if(isset($_POST['submitinupp']))
{
$connection = ssh2_connect('server.example.com', 22);
ssh2_auth_password($connection, 'root', 'topsecret');
$name = $_POST["user"];
$pass = $_POST["pass"];
$stream = ssh2_exec($connection, "./test.sh $name $pass");
echo stream_get_contents($stream);
}
?>
Comment