Jump to content

ssh2_exec() problem run simple command "ls"


FD_F

Recommended Posts

$con = ssh2_connect("127.0.0.1",22);
ssh2_auth_password($con, 'user', 'pass'); 
$stream = ssh2_exec($con, 'w');
stream_set_blocking($stream, true);
  $output = stream_get_contents($stream);
  echo $output;
  
  unset($con);

 

when i using ssh2_exec($con, 'w'); its ok

 

when i using simple linux  ls command -  ssh2_exec($con, 'ls'); i dont get any output

 

any idea why?, thanks

Link to comment
https://forums.phpfreaks.com/topic/187177-ssh2_exec-problem-run-simple-command-ls/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.