System: Linux
Server: XAMPP
Goal:
ssh-connection to a server (later: doing some stuff on this server, not part of this question)
Test-Code:
<?php
set_include_path(get_include_path().PATH_SEPARATOR.'/home/myusername');
include('Net/SSH2.php');
$ssh = new Net_SSH2('123.45.6.78');
if (!$ssh->login('user', 'password')) {
exit('Login Failed');
}else{
echo "connected".'<br>';
echo $ssh->exec('whoami').'<br>';
echo $ssh->exec('hostname')).'<br>';
}
?>
Output:
connected
(M4300-28G-PoE+) >
(M4300-28G-PoE+) >
Problem:
I do not get any errors (neither in the output of the website (see above) nor in /opt/lampp/logs/error_logs), so:
Question(s):
Why am I not getting any output (user, hostname)?
Are there other/better ways to check whether I am properly connected?