Jump to content

empty stream


cucuru

Recommended Posts

hello, I'm using ssh2 extension, the comands execute perfect, but I can't read the response, the returned value of ssh2_exec is always empty:

 

        		if(!($stream = ssh2_exec($con, "ls -al" )) ){
            			echo "fail: unable to execute command\n";
        		} else{
            			// collect returning data from command
            			stream_set_blocking( $stream, true );
			if (!fread($stream,4096)){
				echo "empty";
			} else {
				echo "something";	
			}            			
  			fclose($stream);
        		}

 

where is my problem? I cant find it!

 

Thank you. Regards

Link to comment
https://forums.phpfreaks.com/topic/188559-empty-stream/
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.