ssh2 mod and exec function

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


Something very strangne happens with the function ssh2_exec, i can't
read the stream answer after execution in the remote computer. I work
with apache 1.3.30 and php 4.3.10 , libssh 2.0.5 . the ssh2 module
looks to work correctly but sftp functions cause a big delay causing
server timeout and ssh2_exec can't read the output. Tryed many things
recommeded in php website and forums but always the first ssh2_exec
reading success and the following ones fail.

$stream=ssh2_exec($conn_id,'/usr/bin/ls ./public_html');

I tryed to read the output with:

stream_set_blocking( $stream, true );
 $cmd=fread( $stream, 4096 );


  while($line = fgets($stream)) {
    $cmd .= $line;


 while( !feof($stream) ) {
         $cmd .= fgets($stream)

Nothing success to catch the output for the second execute order. In
the same process only the first exec could be read.
Anybody know

Site Timeline