1

i'm using phpseclib's Net_SSH2 class to execute a number of commands on a remote server. I need to retrieve the content of a certain XML file from the server. Problem is when i run a linux cat cmd like so:

$ssh = new Net_SSH2($host, $port);
if($ssh->connect($username, $password)){

  $script = "cat '$xml_file'"; 
  $output = $ssh->exec($script);
}else{
  exit('Login Failed');
}

the $output is an empty array. I double checked it by running the $script command on the server itself via putty and here the contents of the xml file is returned. Is this an implementation issue with phpseclib that prevents it from returning the proper output?

4

0 に答える 0