Greetings.
I'm executing a simple command via SSH (apachectl) and I'd like to get its output. Is it possible? I've tried all sorts of things but couldn't get to a solution. Here's my code:
$sshMethods = array(
'kex' => 'diffie-hellman-group1-sha1',
'client_to_server' => array(
'crypt' => '3des-cbc',
'comp' => 'none'
),
'server_to_client' => array(
'crypt' => 'aes256-cbc,aes192-cbc,aes128-cbc',
'comp' => 'none'
)
);
$sshCallbacks = array('' => '');
$sshConn = ssh2_connect('myserver.com', 22, $sshMethods, $sshCallbacks);
ssh2_auth_password($sshConn, 'you', 'wish');
ssh2_exec($sshConn, "apachectl configtest");
// And now I'm stuck
TIA,