php - Real-time SSH output with Net_SSH (phpseclib) -


i use net_ssh (phpseclib) execute ssh commands on external server. cannot figure out how have real-time output command. know how make run in background it's not dependant on apache process, it's unclear how i'd go showing external output in real-time instead of having wait command finish.

my current code simple $ssh->exec('command').

the php version used is:

[admin@ ~]$ php -v php 7.1.9 (cli) (built: sep 10 2017 11:31:06) ( nts ) copyright (c) 1997-2017 php group zend engine v3.1.0, copyright (c) 1998-2017 zend technologies 

try this:

$ssh->exec('ping 127.0.0.1', function($output) {     echo $output; }); 

i post output doing wouldn't show delay between each of successive responses server (indicating real time nature of output) i'd try out.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -