php - START a proccess in background in WINDOWS -


i have problem running command php script. command trying run is

echo y | plink -ssh -n -d 9999 admin@1.2.3.4 -pw admin -v

the thing command runs script freezes until execution of plink command, don't want. tried (running in background) :

start /min "cmd.exe" /c "plink -ssh -n -d 9999 admin@1.2.3.4 -pw admin"

and see minimized plink running, , close it, script continues.

i tried:

start /b /min "cmd.exe" /c "plink -ssh -n -d 9999 admin@1.2.3.4 -pw admin"

and same thing, showing output in php script.

this function :

function create_tunnel($ip,$user,$pass,$port) {     exec('start /min cmd /c "echo y | plink -ssh -n -d '.$port.' '.$user.'@'.$ip.' -pw '.$pass.' -v" > nul'); } 

what must run command , let php script continue execution? in linux simple, use screen command.

thanks.

try symfony process component:

$process = new process('ls -lsa'); $process->start();  while ($process->isrunning()) {     // waiting process finish }  echo $process->getoutput(); 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -