3

I'm trying to get phpseclib to work with my current project. I've tried the example code given by its website but all it returns is an error 500. There are no logs for this error whatsoever.

include('Net/SSH2.php');

$ssh = new Net_SSH2('www.domain.tld');
if (!$ssh->login('username', 'password')) {
    exit('Login Failed');
}

echo $ssh->exec('pwd');
echo $ssh->exec('`ls -la`');

When logging in with PuTTY for the first time the server requests a key exchange. I'm not sure if I need to capture this with phpseclib too because all I can think of right now is that the server is waiting for the key exchange but with no answer thus leading to my browser displaying an error 500 instead of the output of ls -la.

EDIT: I've tried to check if it's my php installation but it is definitely not. I'm getting the error once I call a function from the phpseclib.

w5m
  • 2,286
  • 3
  • 34
  • 46
Stantastic
  • 102
  • 9

0 Answers0