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
Post a Comment